-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Node.js] webdriver.get not open browser window with promise.then #2233
Comments
I haven't found the actual bug, but I did fix this specific instance of it with the cleanup in 0342309 |
Wow, it's a lot of cleanups. I'll try the dev branch code later and post feedback here. |
I squashed 5 or 6 commits into one before pushing. The changes that actually "fixed" this were all in lib/webdriver.js |
aha~ I use the last version of lib/webdriver.js to replace it in my node_modules/selenium/lib/webdriver.js , then everything went ok. looks this bug had gone. 👍 but I'm still want to know what is the root reason caused this bug, do you know which part of the old code is wrong? |
I haven't closed this bug because I haven't found the bug yet. I can see where the promise manager gets stuck in the logs, I just don't understand why yet. |
looking forward to hear from you when you found this bug. thanks! |
This has the same underlying cause as #3037, so closing this to consolidate tracking. |
@jleyba thank you for noticing me that, appreciate. |
Meta - driver.get not open the browser window
OS: linux & win32
Selenium Version: 2.53.2
Browser: chrome
Browser Version: 50.0.2661.102 m
Expected Behavior -
use the following javascript code to open browser window
Actual Behavior -
after run, there's no window opened by webdriver. the program hang.
I run this code under nodejs v6.0.0
Steps to reproduce -
I had experienced a very strange bug with nodejs & selenium-webdriver recently. It looks related with nodejs event loop / promise / selenium-webdriver.
In short: webdriver.get call will hang when use with some promise.then.
First, let's see a piece of javascript code which works well:
This code will open a browser window, which works as expected.
But all of the following code will show strange behaviour.
Bug - driver.get will hang
after add a dummy .then(() => 'test')
Fix1 - delete the 1st then call
Fix2 - or add a catch call
Fix3 - or resolve the promise with a setTimeout instead of resolve directly
All of the above code is tested under nodejs v6.0.0.
Has there anybody met this kind of problem before? What's the reason behind this?
I thought it maybe related with the nodejs event loop, or native promise implementation... but I'm dont know how to dig deeper any more.
Code in Gist: https://gist.github.com/zixia/77896cbd446c7282f760c60a025fee17
Stackoverflow: https://stackoverflow.com/questions/37692364/selenium-webdriver-hang-in-very-simple-javascript-code-with-promise-then
The text was updated successfully, but these errors were encountered: