selenium 脚本在windows下正常运行,但是在linux下的jenkins运行报错。

[2017-03-06 18:19:04] [INFO] RetryCount=0
[2017-03-06 18:19:04] [INFO] SourceDir=src/main/java/com/test/testcases
[2017-03-06 18:19:04] [INFO] SourceEncoding=UTF-8
[2017-03-06 18:19:04] [INFO] 当前操作系统是:[Linux]
[2017-03-06 18:19:04] [INFO] 启动测试浏览器:[chrome]
[2017-03-06 18:19:04] [ERROR] 浏览器不能正常工作,请检查是不是被手动关闭或者其他原因
java.lang.IllegalStateException: The driver is not executable: /var/lib/jenkins/workspace/seltest/res/driver/chrome/linux/chromedriver
at com.google.common.base.Preconditions.checkState(Preconditions.java:518)
at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:127)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:118)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:302)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:124)
at main.java.com.test.utils.SelectBrowser.selectExplorerByName(SelectBrowser.java:60)
at main.java.com.test.utils.SeleniumUtil.launchBrowser(SeleniumUtil.java:54)
at main.java.com.test.base.BaseParpare.startTest(BaseParpare.java:41)
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)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问