无法在Linux平台上通过Jenkins中的Selenium启动Chrome浏览器

编程入门 行业动态 更新时间:2024-10-25 20:25:27
本文介绍了无法在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浏览器

本文发布于:2023-11-16 10:06:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1603310.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:浏览器   平台上   Linux   Jenkins   Chrome

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!