在ubuntu服务器上运行maven项目时出现chrome无法访问错误

时间:2017-07-12 07:45:31

标签: google-chrome selenium ubuntu xvfb

从mac机器上的命令行在ubuntu服务器上运行maven项目时出现以下错误,任何人都可以请求如何解决以下问题:

在ubuntu服务器上使用的

命令:
Xvfb:11 -ac&
export DISPLAY =:11
mvn clean install -f pom.xml(来自我存在pom的项目位置)

Selenium版本:3.4.0
ChromDriver版本:2.28 / 2.30
Chrome版本:59.0.3071.115
os版本:' 4.4.0-83-generic'
java版本:' 1.8.0_131'

以下是错误:

FAILED CONFIGURATION:@BeforeMethod beforeMethod(public void tcname()抛出java.io.IOException,java.lang.NumberFormatException,java.lang.InterruptedException) org.openqa.selenium.WebDriverException:chrome无法访问   (驱动程序信息:chromedriver = 2.28.455506(18f6627e265f442aeec9b6661a49fe819aeeea1f),platform = Linux 4.4.0-83-generic x86_64)(警告:服务器未提供任何堆栈跟踪信息) 命令持续时间或超时:114.37秒 构建信息:版本:' 3.4.0',修订版:'未知',时间:'未知' 系统信息:主机:' XXXXX',ip:' 127.0.1.1',os.name:' Linux',os.arch:' amd64& #39;,os.version:' 4.4.0-83-generic',java.version:' 1.8.0_131' 驱动程序信息:driver.version:ChromeDriver     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)     在org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)     在org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)     在org.openqa.selenium.remote.JsonWireProtocolResponse.lambda $ new $ 0(JsonWireProtocolResponse.java:53)     在org.openqa.selenium.remote.JsonWireProtocolResponse.lambda $ getResponseFunction $ 2(JsonWireProtocolResponse.java:91)     在org.openqa.selenium.remote.ProtocolHandshake.lambda $ createSession $ 22(ProtocolHandshake.java:365)     at java.util.stream.ReferencePipeline $ 3 $ 1.accept(ReferencePipeline.java:193)     at java.util.Spliterators $ ArraySpliterator.tryAdvance(Spliterators.java:958)     at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)     at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)     at java.util.stream.FindOps $ FindOp.evaluateSequential(FindOps.java:152)     at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)     在java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)     在org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:368)     在org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:159)     在org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)     在org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)     在org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)     在org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)     在org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)     在org.openqa.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:137)     在org.openqa.selenium.chrome.ChromeDriver。(ChromeDriver.java:184)     在org.openqa.selenium.chrome.ChromeDriver。(ChromeDriver.java:171)     在org.openqa.selenium.chrome.ChromeDriver。(ChromeDriver.java:124)     at tcname.beforeMethod(NoBrokerTestMainBase.java:129)     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:108)     at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)     在org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)     在org.testng.internal.Invoker.invokeMethod(Invoker.java:599)     at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)     at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)     at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)     at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)     在org.testng.TestRunner.privateRun(TestRunner.java:744)     在org.testng.TestRunner.run(TestRunner.java:602)     在org.testng.SuiteRunner.runTest(SuiteRunner.java:380)     在org.testng.SuiteRunner.run顺序(SuiteRunner.java:375)     在org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)     在org.testng.SuiteRunner.run(SuiteRunner.java:289)     在org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)     在org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)     at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)     在org.testng.TestNG.runSuitesLocally(TestNG.java:1226)     在org.testng.TestNG.runSuites(TestNG.java:1144)     在org.testng.TestNG.run(TestNG.java:1115)     在org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:283)     在org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)     在org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120)     在org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:386)     在org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:323)     在org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:143)

0 个答案:

没有答案