Browsers are closed abruptly while running in parallel | Selenium Forum
M
Posted on 23/08/2015
Hi All,

For the past couple of week I am facing issue with Selenium Grid. When I run a test case on multiple browsers simultaneously ,it gets closed abruptly . I am not sure how to fix this issue, please help?


Console O/P
org.openqa.selenium.WebDriverException: Error communicating with the remote browser. It may have died.
Build info: version: '2.46.0', revision: '87c69e2', time: '2015-06-04 16:16:47'
System info: host: 'D5WR710-227-206', ip: '135.25.227.206', os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_75'
Driver info: driver.version: EventFiringWebDriver
Command duration or timeout: 472 milliseconds
Build info: version: '2.46.0', revision: '87c69e2', time: '2015-06-04 16:17:10'
System info: host: 'D5WR710-227-206', ip: '135.25.227.206', os.name: 'Windows Server 2008 R2', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_75'
*** Element info: {Using=xpath, value=//*[@id='mgmt_select_button_loc']/span[2]}
Session ID: 4858bd3e-7c10-4663-81c8-2812d5f35481
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{platform=WINDOWS, javascriptEnabled=true, acceptSslCerts=true, browserName=firefox, rotatable=false, locationContextEnabled=true, webdriver.remote.sessionid=4858bd3e-7c10-4663-81c8-2812d5f35481, version=38.0.5, databaseEnabled=true, cssSelectorsEnabled=true, handlesAlerts=true, webStorageEnabled=true, nativeEvents=false, applicationCacheEnabled=true, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:605)
at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:383)
at org.openqa.selenium.remote.RemoteWebDriver.findElementsByXPath(RemoteWebDriver.java:459)
at org.openqa.selenium.By$ByXPath.findElements(By.java:353)
at org.openqa.selenium.remote.RemoteWebDriver.findElements(RemoteWebDriver.java:346)
at org.openqa.selenium.support.ui.ExpectedConditions.findElements(ExpectedConditions.java:824)
at org.openqa.selenium.support.ui.ExpectedConditions.access$2(ExpectedConditions.java:822)
at org.openqa.selenium.support.ui.ExpectedConditions$8.apply(ExpectedConditions.java:231)
at org.openqa.selenium.support.ui.ExpectedConditions$8.apply(ExpectedConditions.java:1)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:209)
at CaaS.Utilities_function.login_fun(Utilities_function.java:63)
at CaaS.Test_Script_1.Test_Case_1(Test_Script_1.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:37)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:368)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.




TestNg xml:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name="Caas concurrent browser" verbose="3" parallel="tests" thread-count="5">
<test name="Firefox Test" >
<classes>
<parameter name="Browser" value="firefox"/>
<class name="CaaS.Test_Script_1" />
</classes>
</test>
<test name="Chrome Test" >
<classes>
<parameter name="Browser" value="chrome"/>
<class name="CaaS.Test_Script_2" />
</classes>
</test>
</suite>



Selenium Commands which I am using to create HUB and Node:

java -jar selenium-server-standalone-2.46.0.jar -role hub

java -jar C:\Users\vr515q\selenium-server-standalone-2.46.0.jar -role webdriver -hub http://localhost:4444/grid/register -port 5557 -browser browserName="firefox",version=ANY,platform=ANY,maxInstances=2 -browserTimeout=500000000 -browser browserName="chrome",version=ANY,platform=ANY,maxInstances=2 -browserTimeout=500000000 -Dwebdriver.chrome.driver=C:\Users\vr515q\Chrome\chromedriver.exe

M
Replied on 23/08/2015

Please zip and mail your project to selenium_training@qtpselenium.com


M
Replied on 27/08/2015

Hi Ashish,

I have emailed you the project, did you get chance to look into that?

Thanks,
Vivek