在Jenkins(** Linux **)上,Selenium Webdriver测试失败. [英] Selenium Webdriver Tests fail on Jenkins(**Linux**) "The driver is not executable"

查看:303
本文介绍了在Jenkins(** Linux **)上,Selenium Webdriver测试失败.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Linux上使用jenkins构建我的maven项目,但是我的硒测试因该异常而失败

I'm trying to build my maven project with jenkins on Linux, but my selenium tests fails with this exception

运行TestSuite 使用以下命令配置TestNG:org.apache.maven.surefire.testng.conf.TestNG652Configurator@61db2215 运行测试:6,失败:1,错误:0,跳过:5,经过时间:0.51秒<<<失败! setup(selenium.TestSelenium)经过的时间:0.392秒<<失败! java.lang.IllegalStateException:该驱动程序不是可执行文件:/var/lib/jenkins/jobs/Synapse Control Center/workspace/ControlCenterTests/./src/test/resources/driver/chromedriver.exe 在com.google.common.base.Preconditions.checkState(Preconditions.java:200) 在org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:125) 在org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:116) 位于org.openqa.selenium.chrome.ChromeDriverService.access $ 000(ChromeDriverService.java:32) 在org.openqa.selenium.chrome.ChromeDriverService $ Builder.findDefaultExecutable(ChromeDriverService.java:137) 在org.openqa.selenium.remote.service.DriverService $ Builder.build(DriverService.java:296) 在org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88) 在org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:116) 在selenium.TestSelenium.setup(TestSelenium.java:43)

Running TestSuite Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@61db2215 Tests run: 6, Failures: 1, Errors: 0, Skipped: 5, Time elapsed: 0.51 sec <<< FAILURE! setup(selenium.TestSelenium) Time elapsed: 0.392 sec <<< FAILURE! java.lang.IllegalStateException: The driver is not executable: /var/lib/jenkins/jobs/Synapse Control Center/workspace/ControlCenterTests/./src/test/resources/driver/chromedriver.exe at com.google.common.base.Preconditions.checkState(Preconditions.java:200) at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:125) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:116) 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:296) at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:116) at selenium.TestSelenium.setup(TestSelenium.java:43)

我了解我将 selenium webdriver 用于Windows,而不是Linux. "java.lang.IllegalStateException:该驱动程序是无法执行"错误,当在ubuntu 14.1上安装的Jenkins上运行TestNG测试用例时出现 而且我想使其在Linux机器上运行,但是我对它并没有太多的经验.我该如何解决? THX

I understand that I used selenium webdriver for the windows not linux. " java.lang.IllegalStateException: The driver is not executable" error is coming when TestNG test cases run on Jenkins install on ubuntu 14.1 And I want to make it running on linux machine, but I don't really have much experience with it. How exactly could I fix it? THX

推荐答案

使用

chmod + x chromedriver

还从构建中删除需要清理,因为它重置

Also remove maven clean from build since it resets

这篇关于在Jenkins(** Linux **)上,Selenium Webdriver测试失败.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆