0

I'm trying to setup Selenium to run with a PHP binding. I keep getting this message:

PHP Fatal error:  Uncaught Facebook\WebDriver\Exception\UnknownServerException: 

The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver.

I get this when I do clean installs of Codeception, PHPUnit and Steward [re-installed the OS, re-installed each test suite according to instructions]. I used to be able to get Selenium2 going on Ubuntu. Since Selenium3 it doesn't seem to work. Any clues?

1 Answer 1

0

I figured it out. In Selenium3 you have to attach a driver as an "environment variable" in Selenium. I think I'm saying this correctly. I used this script:

# Install ChromeDriver.
wget -N http://chromedriver.storage.googleapis.com/2.27/chromedriver_linux64.zip -P ~/
unzip ~/chromedriver_linux64.zip -d ~/
rm ~/chromedriver_linux64.zip
sudo mv -f ~/chromedriver /usr/local/share/
sudo chmod +x /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver

# Install Selenium.
wget -N http://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar -P ~/
sudo mv -f ~/selenium-server-standalone-3.0.1.jar /usr/local/share/
sudo chmod +x /usr/local/share/selenium-server-standalone-3.0.1.jar
sudo ln -s /usr/local/share/selenium-server-standalone-3.0.1.jar /usr/local/bin/selenium-server-standalone-3.0.1.jar

Then I launched Selenium with this command:

java -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver -jar /usr/local/bin/selenium-server-standalone-3.0.1.jar

Should be about the same with Ghecko.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .