cucumber / cucumber-js

Cucumber for JavaScript
https://cucumber.io
MIT License
5.06k stars 1.09k forks source link

org.openqa.selenium.NoSuchSessionException: Session ID is null. Using WebDriver after calling quit()? #1102

Closed HMaheshwari closed 6 years ago

HMaheshwari commented 6 years ago

While running scenario outline in cucumber, gettting exception and scenarios failed.

Note : As First scenario works fine the rest of scenarios were failed.

in cucumber After hooks i have called "quit()" method while launching browser again getting below exception

Selenium webdriver version : 3.12 Chrome version : 66 Cucumber version : 1.2.5 (from info.cukes sources)

++++++++++++++++++++++++++++++++++++++++++++++++++++ Exception:

org.openqa.selenium.NoSuchSessionException: Session ID is null. Using WebDriver after calling quit()? Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z' System info: host: 'XYS', ip: 'XYZ', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131' Driver info: driver.version: RemoteWebDriver at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:125) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545) at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:273) at org.openqa.selenium.remote.RemoteWebDriver$RemoteNavigation.to(RemoteWebDriver.java:856) at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringNavigation.to(EventFiringWebDriver.java:509)

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

charlierudolph commented 6 years ago

That doesn't look like an issue with cucumber. Based on the error message, that appears to be improper use of the web driver

HMaheshwari commented 6 years ago

Hi @charlierudolph I think its realated to cucumber-java not to cucumber-js but looks like its issue to me as it was already reported previously but it is closed without resolution. please refer link https://github.com/cucumber/cucumber-jvm/issues/1376 where i've shared my code as well. let me know if I'm missing anything. thanks

KyleFairns commented 6 years ago

Are you reopening the browser in the Before Hook?

Looks to me like you’re still referencing the closed session.

Switch to an open session in the before hook.

It’s correct that this isn’t an issue with Cucumber, and it’s an issue with how you’re using Selenium.

HMaheshwari commented 6 years ago

@KyleFairns no,I am not opening the browser in before hook but i've tried by initializing driver in before hook as well but got same exception

KyleFairns commented 6 years ago

Is there another before hook or after hook trying to interact with the browser after you close it or before the new one is open?

aslakhellesoy commented 6 years ago

Can we close this?

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.