-
Notifications
You must be signed in to change notification settings - Fork 2.3k
This driver instance does not have a valid session ID after browser.restart() #3648
Comments
So after investigation, I also tried a few things. This is what I think is happening... the browser object is not being reassigned after we attempt to replace the browser object on a restart. First experiment, run the existing test and verify sessions:Running your test, webdriver creates a new session
After that, we call restart. We are still looking for this session:
But when I navigate to http://localhost:4444/wd/hub, the sessions that are still open are reported as Second experiment, report sessions based on browser and protractor.browser:
|
This appears to be a TypeScript bug when importing |
Attempts to fix: Since the global protractor worked, possibly using the global browser will also work. I changed the |
I am still seeing this issue. Protractor 5.2.2, node 7.10.1, typescript 2.6.1. After EDIT: I attempted to create a minimal test case to reproduce this issue, and I discovered it was being caused by the |
Isn't it that the import of browser is static, so if your browser restart, you must instead use |
restart browser works fine for me but when I run scripts on Jenkins I see the same issue. |
Bug report
6.7.0
4.0.9
chromedriver_2.24
OS X 10.11.6
Clone browser-restart-bug to reproduce the bug.
Similar issue has been reported here: #2001 (note that I still see the bug with the latest protractor).
I use protractor together with typescript. My test looks like this:
This fails with:
If I don't import
browser
at the first line, test works (tsc
fails, but test itself passes). If I useprotractor.browser
instead ofbrowser
test passes as well.The text was updated successfully, but these errors were encountered: