With the help of this function: browser.getAllWindowHandles().
I read some advice for this situation, but nothing helped me.īasically, I can get without restarting browser but in this case I want to close all active tabs after each test and I also don’t know ho to do it. I wrote a pack of tests and separately each of them works correctly (for each test I created separate file - it important for my case), but when I try to run them all together I have some problems:Īt the first I tried to restart browser after each test with “restartBrowserBetweenTests: true” option but as a result I receive next error:įailed: This driver instance does not have a valid session ID (did youĬall WebDriver.quit()?) and may no longer be used. Click the browser you are currently running for the correct instructions: IE 7.x IE 8.0 or above Firefox Google Chrome Safari Resetting Internet Explorer 7.