我正在尝试设置Selenium,以便使用PHP绑定运行。我一直收到这样的消息:
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.当我干净地安装了PHPUnit和Steward 重新安装操作系统,按照说明重新安装每个测试套件。时,我就得到了这个结果。我曾经能够让Selenium2在Ubuntu上运行。由于Selenium3,它似乎不起作用。有什么线索吗?
发布于 2017-03-31 17:50:08
我想通了。在Selenium3中,您必须将驱动程序作为Selenium中的“环境变量”附加。我想我说得对。我用了这个脚本:
# 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然后,我使用以下命令启动Selenium:
java -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver -jar /usr/local/bin/selenium-server-standalone-3.0.1.jarGhecko也应该是一样的。
https://serverfault.com/questions/841161
复制相似问题