[英]Unable to launch Chrome browser through Selenium in Jenkins on Linux platform
Jenkins is showing message starting the chromedriver but the chromedriver is not triggered and testcase fails.i dont know why it is happening Jenkins正在显示启动chromedriver的消息,但是chromedriver没有触发并且测试用例失败。我不知道为什么会发生
Note: the xml created for this code runs successfully on terminal.i think issue is with chromedriver 注意:为此代码创建的xml在终端上成功运行。我认为问题出在chromedriver
SELENIUM CODE: 硒代码:
public class cmddd {
@Test
public void f() throws InterruptedException {
System.setProperty("webdriver.chrome.driver", "/home/dev2/Downloads/newchromedriver/chromedriver");
WebDriver m = new ChromeDriver();
m.get("https://www.google.com/");
System.out.println("passed");
}
}
JENKINS OUTPUT:
Building in workspace /home/dev2/eclipse-workspace/seffcon
[seffcon] $ /bin/sh -xe /tmp/jenkins170843147783066328.sh
+ ./cd.sh
[TestNG] Running:
/home/dev2/eclipse-workspace/seffcon/cd.xml
Starting ChromeDriver 2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7) on port 20671
Only local connections are allowed.
===============================================
Suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================
Build step 'Execute shell' marked build as failure
Finished: FAILURE
This error message... 此错误消息...
Starting ChromeDriver 2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7) on port 20671
Only local connections are allowed.
.
Build step 'Execute shell' marked build as failure
Finished: FAILURE
...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser ie Chrome Browser session. ...暗示ChromeDriver无法启动/产生新的WebBrowser,即Chrome浏览器会话。
Your main issue is the incompatibility between the version of the binaries you are using as follows: 您的主要问题是所使用的二进制版本之间的不兼容性 ,如下所示:
Supports Chrome v66-68 支持Chrome v66-68
@Test
. 执行您的@Test
。 driver.quit()
within tearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully. 始终在tearDown(){}
方法内调用driver.quit()
,以优雅地关闭和破坏WebDriver和Web Client实例。 Check your chromedriver version and chromebrowser version. 检查您的chromedriver版本和chromebrowser版本。 I had noticed this behaviour when there is a version mismatch. 当版本不匹配时,我已经注意到这种现象。
You can refer this link http://chromedriver.chromium.org/downloads 您可以参考此链接http://chromedriver.chromium.org/downloads
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.