本文介绍了无法在Linux平台上通过Jenkins中的Selenium启动Chrome浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Jenkins正在显示启动chromedriver的消息,但未触发chromedriver并且测试用例失败.我不知道为什么会发生
Jenkins is showing message starting the chromedriver but the chromedriver is not triggered and testcase fails.i dont know why it is happening
注意:为此代码创建的xml在终端上成功运行.我认为问题出在chromedriver
Note: the xml created for this code runs successfully on terminal.i think issue is with chromedriver
硒代码:
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("www.google/"); 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推荐答案
检查您的chromedriver版本和chromebrowser版本.当版本不匹配时,我已经注意到这种现象.
Check your chromedriver version and chromebrowser version. I had noticed this behaviour when there is a version mismatch.
您可以引用此链接 chromedriver.chromium/downloads
更多推荐
无法在Linux平台上通过Jenkins中的Selenium启动Chrome浏览器
发布评论