3

I am trying to use Selenium with Java and Firefox but I am getting the below issue.

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Failed to read marionette port
  • ubuntu 22.04 LTS
  • Geckodriver version: 0.330
  • Firefox version: 116.0.3

1 Answers1

3

I think there is bug in firefox binary installed using apt/snap, I faced same issue when I installed firefox from apt package respository. I solved this by downloading firefox from official mozilla source and symlinked binary to /usr/bin/firefox/

First remove firefox from you system.

apt remove firefox

Download firefox from official source. (You may need to replace download URL)

wget https://download-installer.cdn.mozilla.net/pub/firefox/releases/116.0.3/linux-x86_64/en-US/firefox-116.0.3.tar.bz2

Extract downloaded archive to location you want. I am using opt to extract archive.

tar -xf firefox-116.0.3.tar.bz2 --directory /opt/

Then symlink firefox binary to /usr/bin

ln -s /opt/firefox/firefox /usr/bin/firefox
Vaibhav Panmand
  • 1,038
  • 7
  • 17