org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash

1,736 views
Skip to first unread message

garvitag...@gmail.com

unread,
May 21, 2018, 1:48:03 AM5/21/18
to Selenium Users
Hi,

I have 2 test suite: 1 sequential and 1 parallel. Sequential runs fine, but for parallel i am hitting this error in CI (local runs fine).

Versions: Chromedriver : 2.38 Chrome : 66 Testng: 6.13 Selenium: 3.11  Here is error stack trace:

org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash
from unknown error: cannot determine loading status
from tab crashed
  (Session info: chrome=66.0.3359.181)
  (Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Linux 4.4.0-72-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: 'runner-b900c259-project-3-concurrent-1', ip: '172.16.76.10', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-72-generic', java.version: '1.8.0_171'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.38.552522 (437e6fbedfa876..., userDataDir: /tmp/.org.chromium.Chromium...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 66.0.3359.181, webStorageEnabled: true}
Session ID: 680b3f37ca133ff4b84c0a43073e160a
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
	at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
	at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)
	at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
	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.RemoteWebElement.execute(RemoteWebElement.java:279)
	at org.openqa.selenium.remote.RemoteWebElement.isDisplayed(RemoteWebElement.java:320)
	at org.openqa.selenium.support.ui.ExpectedConditions.elementIfVisible(ExpectedConditions.java:315)
	at org.openqa.selenium.support.ui.ExpectedConditions.access$100(ExpectedConditions.java:44)
	at org.openqa.selenium.support.ui.ExpectedConditions$7.apply(ExpectedConditions.java:206)
	at org.openqa.selenium.support.ui.ExpectedConditions$7.apply(ExpectedConditions.java:202)
	at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:248)
	at ipd.Base.select_value(Base.java:440)
	at ipd.project.analytics.ChartUtil.createChart(ChartUtil.java:44)
	at ipd.project.analytics.LineChart.makeLineChart(LineChart.java:48)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:571)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:707)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:979)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

For parallel , its giving error on random lines. Like in this its on ipd.Base.select_value(Base.java:440), for other test its on assertJsException method with error session not found.
It was working fine on CI till we updated it to latest versions. Tests are running inside docker. With these versions , its still fine on local. 
If it is memory issue, it was running fine in CI with older versions selenium:3.4 Chromedriver:2.31 Testng:6.11. 

Thanks !! 

Jonathan Herbaut

unread,
May 22, 2018, 10:42:10 AM5/22/18
to seleniu...@googlegroups.com
Are you sure you are working with the correct session of your webdriver when you execute your parallel test ?
I have faced the same issue and I remember that it was my fault because when I closed the session of my first parallel test, the other test was trying to execute its code on the previous session but was closed by the garbage collector or my disposable class that shared the session...
I have tested a very large number of different version of Selenium and when I fixed my issue, I have never encountered this kind of issue anymore

garvitag...@gmail.com

unread,
May 24, 2018, 2:54:43 AM5/24/18
to Selenium Users
Hi Jonathan,

I am not kinda sure that every test starts new session. If this was the scenario, it should have failed on local too. But its only failing on CI. I am using allure reports, i get to see for parallel tests, its failing on any random line for every test generally on explicit wait or assertion.

How can i check in CI, if all test are starting on their own session?

Thanks !!
Reply all
Reply to author
Forward
0 new messages