-
Notifications
You must be signed in to change notification settings - Fork 849
Description
What are you trying to achieve? (Expected behavior)
I want to run the example.php
What do you get instead? (Actual behavior)
PHP Fatal error: Uncaught Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to
/session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"binary":"",
"args":["--no-sandbox","--headless","--disable-gpu"]}}}
Operation timed out after 30000 milliseconds with 0 out of -1 bytes received in /var/www/html/php-selenium/vendor/f
acebook/webdriver/lib/Remote/HttpCommandExecutor.php:292
Stack trace:
#0 /var/www/html/php-selenium/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php(126): Facebook\WebDriver\Rem
ote\HttpCommandExecutor->execute(Object(Facebook\WebDriver\Remote\WebDriverCommand))
#1 /var/www/html/php-selenium/example.php(38): Facebook\WebDriver\Remote\RemoteWebDriver::create('http://localhos..
.', Object(Facebook\WebDriver\Remote\DesiredCapabilities), 5000)
#2 {main}
thrown in /var/www/html/php-selenium/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php on line 292
Fatal error: Uncaught Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /sess
ion with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"binary":"","args
":["--no-sandbox","--headless","--disable-gpu"]}}}
Operation timed out after 30000 milliseconds with 0 out of -1 bytes received in /var/www/html/php-selenium/vendor/f
acebook/webdriver/lib/Remote/HttpCommandExecutor.php:292
Stack trace:
#0 /var/www/html/php-selenium/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php(126): Facebook\WebDriver\Rem
ote\HttpCommandExecutor->execute(Object(Facebook\WebDriver\Remote\WebDriverCommand))
#1 /var/www/html/php-selenium/example.php(38): Facebook\WebDriver\Remote\RemoteWebDriver::create('http://localhos..
.', Object(Facebook\WebDriver\Remote\DesiredCapabilities), 5000)
#2 {main}
thrown in /var/www/html/php-selenium/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php on line 292
How could the issue be reproduced? (Steps to reproduce)
php example.php
###example.php####
namespace Facebook\WebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Chrome\ChromeOptions;
require_once('vendor/autoload.php');
// start Chrome with 5 second timeout
$host = 'http://localhost:4444/wd/hub'; // this is the default
$capabilities = DesiredCapabilities::chrome();
$options = new ChromeOptions();
#$options->setBinary("/usr/bin/chrome");
$options->addArguments(array(
// '--window-size=571,428',
//'--disable-dev-shm-usager',
"--no-sandbox","--headless", "--disable-gpu",
));
$capabilities->setCapability(ChromeOptions::CAPABILITY, $options);
$driver = RemoteWebDriver::create($host, $capabilities, 5000);
// navigate to 'http://www.seleniumhq.org/'
//$driver->get('https://www.google.com/');
$driver->get('https://www.seleniumhq.org/');
### Details
<!-- Please fill relevant following versions: -->
$ chromedriver
Starting ChromeDriver 2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881) on port 9515
Only local connections are allowed.
PHP Version 7.3.6
Selenium server version:
java -jar /usr/local/bin/selenium-server-standalone.jar
08:01:37.030 INFO - Selenium build info: version: '3.8.1',
cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
chrome --version
Google Chrome 75.0.3770.80