简体   繁体   中英

Selenium Not able to run Firefox browser from Jenkins

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"

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 ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM