英文:
Jenkins is failing to find Chrome browser for automated tests - what can I do?
问题
I'm trying to start to run my tests in Jenkins using Java + Selenium + TestNG. For example, I'm trying to get the title of google.com. In my IDE, everything works correctly, my code is in Git, Jenkins starts and compiles the project. To ensure that everything is correct, my simple method prints some text, and it works. ChromeDriver was started successfully.
But the WebDriver (Chrome Driver) encounters this problem image issue.
I've searched everywhere for a solution, and everyone says to make sure that the Chrome browser and WebDriver version are the same. It is correct; the versions are the same.
I think the WebDriver can't find the Chrome browser:
"The process started from the Chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed."
How can I run the test with WebDriver or how can I specify the path to Chrome browser for the WebDriver?
I would be grateful for any help. Thanks and have a good day!
英文:
I'm trying to start to run in Jenkins my tests
java + selenium+ TestNG
for exemple Im try to get title on google.com
In my IDE all work correct, my code in git, jenkins starting, compile project
To sure that all correct my simple method print some text, its work
ChromeDriver was started successfully.
but webdriver (chrome driver) get this problem image issuge
Im search issue every were says make sure thats Chrome browser and webdriver version the same. it correct version is the same
Im think that webdriver can't find to chrome browswer:
> "The process started from chrome location /usr/bin/google-chrome is
> no longer running, so ChromeDriver is assuming that Chrome has
> crashed.) "
How can I run test with webdriver or how to show for webdriver path to Chrome browser?
I will be grateful for any help
Thanks and have a good day!
stacktrace 1
stacktrace 2
答案1
得分: 1
Great!
Murat Ishen 谢谢你!
它起作用了
ChromeOptions opt = new ChromeOptions();
opt.setBinary("/usr/bin/google-chrome-stable"); //在此指定了Chrome二进制文件的位置
opt.addArguments("--headless");
opt.addArguments("--no-sandbox");
driver = new ChromeDriver(opt);
英文:
Great!
Murat Ishen Thank You!
it is works
ChromeOptions opt = new ChromeOptions();
opt.setBinary("/usr/bin/google-chrome-stable"); //chrome binary location specified here
opt.addArguments("--headless");
opt.addArguments("--no-sandbox");
driver = new ChromeDriver(opt);
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论