在Jenkins无浏览器中:org.openqa.selenium.WebDriverException:与远程浏览器通信时出错.它可能已经死了

在Jenkins无浏览器中:org.openqa.selenium.WebDriverException:与远程浏览器通信时出错.它可能已经死了

问题描述:

我正在使用Selenium Web驱动程序和Java在Jenkins无头浏览器上执行脚本.运行两个或三个脚本后,出现以下错误,我将观察到这个问题,我将在一次运行中运行多个脚本,但是当我执行单个脚本时,它不会出现任何错误.请帮我解决这个问题.下面是错误代码.

Hi I am executing scripts on Jenkins headless browser using Selenium web driver and Java. After two or three scripts run I am getting below error this problem I observer when I will run multiple scripts at one run but when I executed single script it will not through any error. Please help me out to solve this problem. Below is the error code.

org.openqa.selenium.WebDriverException: Error communicating with the remote browser. It may have died.
Build info: version: '2.51.0', revision: '1af067d', time: '2016-02-05 19:15:17'
System info: host: 'devui1.pdx.aws', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-573.7.1.el6.x86_64', java.version: '1.7.0_95'
Driver info: driver.version: EventFiringWebDriver
Session ID: b825d792-ea66-4422-9b19-fcbb29a0cb95
Capabilities [{platform=LINUX, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, nativeEvents=false, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=38.6.0}]Command duration or timeout: 742 millisecondsBuild info: version: '2.48.2', revision'41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'Admin-HP', ip: '10.242.2.8', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_102'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, databaseEnabled=true, handlesAlerts=true, version=38.6.0, platform=LINUX, nativeEvents=false, acceptSslCerts=true, webdriver.remote.sessionid=e490f05e-8796-4539-b749-bc198990603d, locationContextEnabled=true, webStorageEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]Session ID: e490f05e-8796-4539-b749-bc198990603d
*** Element info: {Using=xpath, value=//div[@data-path='assignmentValue']//a[@class='remove-filter']//span[@class='glyphicon glyphicon-remove-circle grey']}
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:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:353)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:490)
at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:345)
at ActionClass.CaseManagement.removeAdminAssigneeFilter(CaseManagement.java:431)
at ActionClass.CaseManagement.searchCaseByAccesion(CaseManagement.java:374)
at StepDefinition.CancelCase.user_Cancel_a_Case(CancelCase.java:63)
at ✽.When User Cancel a Case(CancelCase.feature:5)

如果我们在脚本中使用driver.quit(),那么我会找到此错误的解决方案.

I have found solution for this error if we use driver.quit() in our scripts then this error will go.