Firefox not opening with webdrivermanager: Response code 500

137 Views Asked by At

I'm using Java 11, Selenium, cucumber project with latest webdrivermanager(5.5.3).

Recently the firefox browser (121 version) is not launching via the tests. Please suggest how to resolve it. I did try setting property to latest downloaded geckodriver. Still same issue. Also tried invalidate cache on the IDE and unistalled and installed the latest firefox.

    private static FirefoxOptions setupFirefoxOptions() {
        System.setProperty("webdriver.gecko.driver", "/Users/<user>/Downloads/geckodriver");

        FirefoxOptions firefoxOptions = new FirefoxOptions();
//        firefoxOptions.setBinary("/Users/Applications/Firefox.app/Contents/MacOS/firefox");
        firefoxOptions.setLogLevel(FirefoxDriverLogLevel.TRACE);

        return firefoxOptions;
    }

The following is the trace logs from geckodriver.

1704383041399   geckodriver INFO    Listening on 127.0.0.1:63769
1704383041517   geckodriver::capabilities   DEBUG   Trying to read firefox version from ini files
1704383041520   geckodriver::capabilities   DEBUG   Found version 121.0
1704383041533   mozrunner::runner   INFO    Running command: MOZ_CRASHREPORTER="1" MOZ_CRASHREPORTER_NO_REPORT="1" MOZ_CRASHREPORTER_SHUTDOWN="1" MOZ_NO_REMOTE="1" "/App ... s" "localhost" "-foreground" "-no-remote" "-profile" "/var/folders/bz/194z010j5yn4zyt048xstkv9gw54lw/T/rust_mozprofileCAlP2I"
1704383041629   geckodriver::marionette DEBUG   Waiting 60s to connect to browser on 127.0.0.1
1704383041629   geckodriver::browser    TRACE   Failed to open /var/folders/bz/194z010j5yn4zyt048xstkv9gw54lw/T/rust_mozprofileCAlP2I/MarionetteActivePort
1704383041629   geckodriver::marionette TRACE   Retrying in 100ms
1704383041734   geckodriver::browser    DEBUG   Browser process stopped: signal: 9 (SIGKILL)
1704383041735   webdriver::server   DEBUG   <- 500 Internal Server Error {"value":{"error":"unknown error","message":"Process unexpectedly closed with status signal","stacktrace":""}}
Could not use local web driver for reason : Could not start a new session. Response code 500. Message: Process unexpectedly closed with status signal
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: 'HOLBMAC2296', ip: 'fe80:0:0:0:14e3:a873:b17d:cdb1%en0', os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '12.6.1', java.version: '11.0.20'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {log: {level: trace}}}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {log: {level: trace}}}}]
      java.lang.NullPointerException
1

There are 1 best solutions below

0
Tulip On

I had to downgrade Firefox to 119 for the automation to work.