[英]Jenkins - ERROR Chrome failed to start: exited abnormally
Ubuntu - Jenkins and GIT in Ubuntu, Java project using selenium Ubuntu - Ubuntu 中的 Jenkins 和 GIT,使用 selenium 的 Java 项目
Trying to run GIT project in Jenkins(Jenkins with Agent node).尝试在 Jenkins(带有代理节点的 Jenkins)中运行 GIT 项目。
Error in Jenkins詹金斯的错误
unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.15.0-39-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 254 milliseconds
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: 'WebTest-VM', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-39-generic', java.version: '1.8.0_191'
Driver info: driver.version: ChromeDriver
Note: Same java + Selenium project able to open chrome browser in local machine注意:相同的 java + Selenium 项目能够在本地机器上打开 chrome 浏览器
System.setProperty("webdriver.chrome.driver", "/home/webtest/Downloads/chromedriver");
WebDriver driver = new ChromeDriver();
Try adding JenkinsFile
to your project and commit to git尝试将JenkinsFile
添加到您的项目并提交到 git
Your JenkinsFile
could have following syntax:您的JenkinsFile
可能具有以下语法:
pipeline {
agent any
tools {
maven 'maven_3_5_0'
}
stages {
stage('Checkout Code from Git') {
steps {
git 'https://github.com/xxxxxxx/your-project.git'
}}
stage('compile stage') {
steps {
bat "mvn clean compile"
}
}
stage('testing stage') {
steps {
bat "mvn test"
}
}
}
}
On Windows Server 2012, just download the chromedriver suitable for your Chrome version.在 Windows Server 2012 上,只需下载适合您的 Chrome 版本的 chromedriver。 Put that driver in common place for all users.将该驱动程序放在所有用户的公共位置。 In Drive C:\\Tools\\Chromedriver
for example.例如在驱动器C:\\Tools\\Chromedriver
中。 Then in your Jenkins instance, just update the env variables with the path to that driver.然后在您的 Jenkins 实例中,只需使用该驱动程序的路径更新 env 变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.