在jenkins中收到此错误org.openqa.selenium.WebDriverException:未知错误:无法发现打开的页面

问题描述 投票:-1回答:1

我试图使用pom.xml在jenkins(@localhost)中运行selenium脚本,但是面临问题w.r.t chrome驱动程序。 Chrome版本52.0 Selenium-server 2.53.0以下是完整的堆栈跟踪:

================================================================

测试运行:7,失败:1,错误:0,跳过:6,时间流逝:63.654秒<<<失败! - 在TestSuite init(com.arrk.pages.AppleTest)中经过的时间:63.416秒<<<失败! org.openqa.selenium.WebDriverException:未知错误:无法发现打开的页面

================================================== ===================(驱动程序信息:chromedriver = 2.9.248315,platform = Windows NT 6.1 SP1 x86_64)(警告:服务器未提供任何堆栈跟踪信息)命令持续时间或超时:60.92秒构建信息:版本:'2.53.0',修订版:'35ae25b1534ae328c771e0856c93e187490ca824',时间:'2016-03-15 10:43:46'系统信息:主持人:'akshayk',ip:'10 .0 .2.58',os.name:'Windows 7',os.arch:'amd64',os.version:'6.1',java.version:'1.8.0_45'

=======================================================================

驱动程序信息:org.openqa.selenium.chrome.ChromeDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl。 java:45)在org.openqa.selenium.remote.ErrorHandler的org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)的java.lang.reflect.Constructor.newInstance(Constructor.java:422)中.throwIfResponseFailed(ErrorHandler.java:158)org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)atg.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)org。 openga.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:131)org.openqa.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:144)org.openqa.selenium.chrome.ChromeDriver。(ChromeDriver.java:170 )org.openqa.selenium.chrome.ChromeDriver。(ChromeDriver.ja va:159)org.openqa.selenium.chrome.ChromeDriver。(ChromeDriver.java:116)at com.arrk.webdriver.WebDriverFactory.getInstance(WebDriverFactory.java:125)at com.arrk.webdriver.WebDriverFactory.getInstance( WebDriverFactory.java:64)位于sun.reflect.NativeMethodAccessorImpl.invoke的Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)中的com.arrk.pages.TestBase.init(TestBase.java:145)(NativeMethodAccessorImpl.java:62)在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:497)org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)at at org.testng.internal.InvokeConfigurationMethod(Invoker.java:510)org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)在org.testng.internal.TestMethodWor的org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:170) ker.run(TestMethodWorker.java:104)atg.testng.TestRunner.privateRun(TestRunner.java:774)org.testng.TestRunner.run(TestRunner.java:624)org.testng.SuiteRunner.runTest(SuiteRunner) .java:359)org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)org.testng.SuiteRunner.run(SuiteRunner.java:261) org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)位于org.testng的org.testng.TestNG.runSuitesSequentially(TestNG.java:1215)的org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)。在org.apache的org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:217)的org.testng.TestNG.run(TestNG.java:1048)上的TestNG.runSuitesLocally(TestNG.java:1140)位于org.apache.maven.surefire.booter.ForkedBooter的org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:92)中的.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84) .invokeProviderInSameClassLoader(佛rkedBooter.java:200)org.apache.maven.surefire.boot.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

尝试了解这个问题的所有可能解决方案。如果有更多的解决方案那么请告诉我。

selenium-webdriver pom.xml selenium-chromedriver headless jenkins-cli
1个回答
0
投票

这看起来类似于Chrome 51-53的错误报告:org.openqa.selenium.remote.server.DriverServlet - Exception: unknown error: unable to discover open pages

该bug链接到主要的Chrome bug "Fails to navigate to URL when Chrome 51 is launched in session 0 / through CI".启动作为Windows服务安装的Jenkins slave使用会话0。

要点是Chrome 51中的第0会话中的Chrome。短期解决方法包括退回到Chrome 50(如果你能找到它),或使用Chrome选项“no-sandbox”运行,如下所示:

ChromeOptions chromeOptions = new ChromeOptions(); 
chromeOptions.AddArguments("test-type"); 
chromeOptions.AddArguments("no-sandbox"); 
PropertiesCollection.driver = new ChromeDriver(chromeOptions);

Chrome 54中预计会有一个修复程序,但是错误响应表明他们没有计划对会话0的长期支持。如果有人知道如何从Windows上的会话0以外的其他东西启动Jenkins从站,我会全力以赴。

© www.soinside.com 2019 - 2024. All rights reserved.