Selenium Not able to run Firefox browser from Jenkins

*爱你&永不变心* 提交于 2021-01-28 12:05:10

问题


I tried running Automated test using selenium on firefox through jenkins on Ubuntu Machine but not able to run it. But the same code is running without failure using Eclipse. I am running it as maven project.

Getting following error-

"[INFO] Running TestSuite
1524549883598   geckodriver INFO    geckodriver 0.20.0
1524549883615   geckodriver INFO    Listening on 127.0.0.1:14395
1524549883939   mozrunner::runner   INFO    Running command: "/usr/lib/firefox/firefox" "-marionette" "-profile" "/tmp/rust_mozprofile.78vmBc1aqdpF"
1524549883941   geckodriver::marionette TRACE     connection attempt 0/600
ExceptionHandler::GenerateDump cloned child 6290
ExceptionHandler::SendContinueSignalToChild sent continue signal to child
ExceptionHandler::WaitForContinueSignal waiting for continue signal...
1524549884041   geckodriver::marionette TRACE     connection attempt 1/600
1524549884141   webdriver::server   DEBUG   <- 500 Internal Server Error {"value":{"error":"unknown error","message":"Process unexpectedly closed with status signal","stacktrace":""}}
Msg Process unexpectedly closed with status signal
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: 'Unknown', ip: 'Unknown', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-96-generic', java.version: '1.8.0_131'
Driver info: driver.version: FirefoxDriver
remote stacktrace: 

Firefox version -60.0b10 Selenium -3.11.0 Using Gecko driver"


回答1:


This error message...

1524549884141   webdriver::server   DEBUG   <- 500 Internal Server Error {"value":{"error":"unknown error","message":"Process unexpectedly closed with status signal","stacktrace":""}}

...implies that the marionette wasn't able to initiate an active connection with the WebClient i.e Firefox browser.

Your main issue is the version compatibility between the binaries you are using as follows :

  • Your Selenium Client version is 3.11.0.
  • Your JDK version is 1.8.0_131 which is pretty ancient.
  • Your GeckoDriver version is v0.20.0.
  • Your Firefox version is unknown to us.

So there is a clear mismatch between the JDK v8u131 , Selenium Client v3.11.0 and GeckoDriver v0.20.0.

Solution

  • Upgrade JDK to recent levels JDK 8u162.
  • Upgrade GeckoDriver to GeckoDriver v0.20.1 level.
  • Ensure that GeckoDriver is present in the specified location as per your code block.
  • Ensure that GeckoDriver is having executable permission for non-root users.
  • Upgrade Firefox version to Firefox v59.0.2 levels.
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Use CCleaner tool to wipe off all the OS chores before and after the execution of your Test Suite.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your Test as a non-root user.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.


来源:https://stackoverflow.com/questions/49995331/selenium-not-able-to-run-firefox-browser-from-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!