Skip to content

Add a 'detach' flag to leave Firefox running after Geckodriver exits #2247

Open

Description

@labkey-tchad

We have a Selenium test runner that intentionally leaves browser windows open for manual inspection when running locally.
Now that Geckodriver automatically quits Firefox when it exits, this is no longer possible.
Would it be possible to add a detach option similar to Chromedriver in order to opt in to leaving the browser running?

Activity

  1. whimboo commented on Jun 9, 2026

    @whimboo
    Collaborator

    Which signal are you sending? I assume it's SIGINT at the moment? Why can't you just send SIGKILL to the process, which cannot be handled by geckodriver?

  2. labkey-tchad commented on Jun 9, 2026

    @labkey-tchad
    Author

    I'm launching Geckodriver via Selenium WebDriver for Java. As far as I can tell, it doesn't provide that level of control over the driver lifecycle.

  3. whimboo commented on Jun 9, 2026

    @whimboo
    Collaborator

    So how did your Selenium testrunner handle it for geckodriver < 0.37.0? Somehow geckodriver must have been killed to keep Firefox running. A normal exit of geckodriver always quits the session first.

  4. labkey-tchad commented on Jun 9, 2026

    @labkey-tchad
    Author

    Something like this:

    FirefoxDriverService driverService = new GeckoDriverService.Builder().build();
    FirefoxDriver driver = new FirefoxDriver(driverService);
    /* do some testing */
    driverService.stop();
    /* Firefox window is left open with geckodriver < 0.37.0 */
  5. whimboo commented on Jun 10, 2026

    @whimboo
    Collaborator

    Ok, I did some more investigation of the Selenium code and it first tries to use SIGTERM to shutdown the driver. For further discussions I filed https://bugzilla.mozilla.org/show_bug.cgi?id=2046321.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions