我们有一个本地的Selenium项目,用于测试网站的用户界面(使用ChromeDriver)。目前,我们正在使用单独的便携式计算机来执行此操作,但是我们希望将此便携式计算机转换为服务器,以便能够从外部访问Jenkins并开始测试。到目前为止,我设法下载了Jenkins映像,安装,下载了最新的Chrome和chromedriver,将项目复制到linux容器上,并尝试使用mvn-post-integration-test
命令运行它,但出现此错误:
SEVERE: org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "/var/jenkins_home/workspace/JenkinsProject/drivers/linux/chromedriver" (in directory "."): error=2, No such file or directory)
[pool-1-thread-1] ERROR net.thucydides.core.webdriver.WebDriverFacade - FAILED TO CREATE NEW WEBDRIVER_DRIVER INSTANCE class org.openqa.selenium.chrome.ChromeDriver: Could not instantiate new WebDriver instance of type class org.openqa.selenium.chrome.ChromeDriver (Timed out waiting for driver server to start.
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: '9c8af7675c2e', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.93-boot2docker', java.version: '1.8.0_171'
Driver info: driver.version: unknown
net.thucydides.core.webdriver.UnsupportedDriverException: Could not instantiate new WebDriver instance of type class org.openqa.selenium.chrome.ChromeDriver (Timed out waiting for driver server to start.
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:24:21.231Z'
System info: host: '9c8af7675c2e', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.9.93-boot2docker', java.version: '1.8.0_171'
Driver info: driver.version: unknown
我的公司禁止我们使用gitlab,因此我们需要始终从本地计算机获取项目。 现在我的问题是: 1.我介绍的stacktrace可能是什么问题?我提到在root上运行也会给我同样的错误。 2.将我们的jenkins +硒项目部署在Docker容器上以无头模式运行chrome(使用ChromeDriver,而不是RemoteWebDriver)的正确方法是什么,该项目从笔记本电脑(而不是从Subversion工具)中提取源项目? 谢谢!