Selenium crashing with selenium.common.exceptions.WebDriverException: Message: newSession

I fixed the issue by updating the selenium python package and using the latest geckodriver.

Thanks @fzbd for all your help.

Additional context -

Refer to the compatibility chart here - https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html#supported-platforms

update selenium :

 pip install -U selenium

update geckodriver (choose the correct version for your needs based on the above compatibility chart)

Check the versions for all components -

firefox -v
geckodriver -V
pip freeze | grep selenium

Thanks @skyfail. Your answer helped me. The following sequence was performed and resolved the issue.

  1. To upgrade selenium run: sudo pip3 install selenium --upgrade

  2. To upgrade geckodriver follow steps 1-3 from this

  3. sudo mv geckodriver /usr/local/bin/geckodriver , /usr/local/bin is usually in your PATH so no need to edit it.