Can't start Firefox WebDriver in a Jenkins pipeline

182 views
Skip to first unread message

Conrad

unread,
Jun 20, 2019, 11:39:16 PM6/20/19
to Selenium Users
I'm trying to run automated tests in a Jenkins pipeline using Selenium's Docker images. I already have headless Chrome working, but not Firefox.

Here is a minimal pipeline script:

node {
    docker.image('selenium/standalone-firefox:3.141.59-radium').inside('-u root:root -e START_XVFB=false') {
        sh '''
            curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python get-pip.py
            pip install selenium
            python -c 'from selenium import webdriver; options = webdriver.FirefoxOptions(); options.set_headless(); wd = webdriver.Firefox(options=options)'
        '''
    }
}

For clarity, here is the Python script:

```python
from selenium import webdriver

options = webdriver.FirefoxOptions()
options.set_headless()
wd = webdriver.Firefox(options=options)
```

The error returned is

```
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
    keep_alive=True)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process
```

I expected using headless mode to resolve this problem as suggested elsewhere. The same shell script also works on my machine. Also the versions of Geckodriver (0.24.0) and Firefox (67) should be compatible as baked in the Docker image.

Peter

unread,
Jun 12, 2020, 1:06:03 PM6/12/20
to Selenium Users
Did you ever find a solution to this? I'm having the same issue running geckodriver inside the selenium container. 

Reply all
Reply to author
Forward
0 new messages