-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selenium Htmlunit driver Problem getting elements on the right page (Vue.JS) #87
Comments
Looks more like a bug in HtmlUnit itself. |
@rbri Here is the full message this is my code
|
Hi danielkp1234, have tried to reproduce your case.
Can you please provide a value (maybe via private mail). |
@rbri try using andr132n |
Ok, thanks, can see the problem now. Will try to fix it. |
@rbri Okay Thanks keep me updated :) |
OK, found it - and i guess you like to get the whole story. The problem is not with HtmlUnit/Driver it is a problem with the application. There is really a bug in the event handler associated with the 'Næste' button. If you run this page in a real browser manually, having the console open you will see the error there also when clicking the button. But HtmlUnit is per default a bit more picky about js errors - HtmlUnit (as test tool) stops the processing and throws an error (browsers are simply logging the error and proceeding to make all the nasty pages out there working ;-). To chance this you have to disable this by calling
There is a short sample how to customize the WebDriver at the bottom of this page (https://github.com/SeleniumHQ/htmlunit-driver). And one more;
Because of this the second wait passes even if you have not changed the page. Maybe you have to add a check for the page content &| title to be sure you are on the right page before you start interacting with the page. Hope that helps...thanks for using HtmlUnit/Driver.... RBRi |
Will close this, please reopen if you still have this problem. |
@rbri Weird cause then that isn't the problem :) I just tried with chrome driver and it was working fine it's on the page it's supposed to be on. But the text variable is empty so i tried to debug it and its on the correct page but this line |
Sorry, now i'm totally confused. Can you please explain your problem step by step. Your login process has three steps with three different pages (i can only test the first and the second). And please include your (complete) source code to give me a chance to understand what you are doing. |
@rbri Here is the complete source code https://pastebin.com/2aMxq8Bh javascript is enabled and setthrowexeceptiononscripterror is false |
Can you please give me the credentials (via private mail). Without seeing the pages i can't do anything. |
@rbri hmm, I am sorry I don't really think i am allowed to give that out :( would it be possible for me to create a dump of the page for u? |
@rbri Hello again i just tried using get page source with both htmlunit driver and chrome driver and here are the results the results look very different and since its the same code and same page they should be identical right? and in the htmlunit page source the elements i am looking for looks to be not existing hope this helps a bit :) |
@rbri So i get though the login part which I first thought to be the issue then it goes fine onto the right page (i have verified with geturl) but it doesn't find the elements and therefore doesn't return anything. Above i have created a page source dump of the page using chromedriver and the page using htmlunit they look very different there is also something saying CDATA is that supposed to be there it's not in the chrome dump |
@rbri Okay now you will be able to fully debug it i cloned the page and hosted it here |
Great idea. Will have a look at this in the evening. If you like you can provide your test code for the new page - this will save some time here. |
@rbri Here is the test code i tried to use
Thanks :) |
Ok, can reproduce your problem now. I fear this is in HtmlUnit. Will investigate this. |
@rbri Thanks |
@rbri How it going? have you found the problem :) |
Not really - but it looks like the page uses vue.js and there seems to be a general problem with vue.js in HtmlUnit. Have written a simple test that fails. Will work on this but this will take some time. |
@rbri Okay Thanks :) |
@rbri Do you have any update on this? |
Made some progress with the Vue.js support but this seems to be still not working. |
@rbri That's Nice :) |
@rbri Hey Ron, is there any way to help with this? I'm also stuck on a vue.js project. |
Sadly, the bunch of recent rhino fixes/additions didn't help. |
So i was trying to switch from using the chrome driver to html unit because it should be faster.
i have javascript enabled and i am getting this error
Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot find function submit in object [object HTMLButtonElement]
I have tried some googling around but I found nothing this is the line where i define the htmlunit driver
HtmlUnitDriver driver = new HtmlUnitDriver(BrowserVersion.FIREFOX_68,true);
The text was updated successfully, but these errors were encountered: