【发布时间】:2018-11-27 17:33:42
【问题描述】:
PHP Fatal error: Uncaught
Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for
http POST to /session with params: {"desiredCapabilities":
{"browserName":"chrome","platform":"ANY"}}
我遇到了这个错误。平台 Linux,操作系统 Ubuntu 16.04。 php脚本:
require_once '/var/www/html/vendor/autoload.php';
$host = 'http://127.0.0.1:4444/wd/hub';
$driver = \Facebook\WebDriver\Remote\RemoteWebDriver::create($host,
\Facebook\WebDriver\Remote\DesiredCapabilities::firefox());
print_r($driver);
我已经安装了 Google Chrome 最新版本和 chromedriver 最新版本 for linux 64。
我是用这段代码运行 selenium 的:
DISPLAY=:99 xvfb-run -a -n 1 -l -s "-screen 0, 1024x768x8" java -Dwebdriver.chrome.driver="/var/www/html/chromedriver-linux" -jar /var/www/html/selenium-server.jar
【问题讨论】:
标签: php google-chrome selenium selenium-chromedriver