Php-webdriver: Chrome crashing

Created on 19 Nov 2017  路  5Comments  路  Source: php-webdriver/php-webdriver

Error: `PHP Fatal error: Uncaught Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY"}}

Operation timed out after 30001 milliseconds with 0 bytes received in /root/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:286
Stack trace:

0 /root/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php(126): Facebook\WebDriver\Remote\HttpCommandExecutor->execute(Object(Facebook\WebDriver\Remote\WebDriverCommand))

1 /root/index.php(9): Facebook\WebDriver\Remote\RemoteWebDriver::create('http://127.0.0....', Object(Facebook\WebDriver\Remote\DesiredCapabilities), 50000)

2 {main}

thrown in /root/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php on line 286`

Run code:
java -Dwebdriver.chrome.driver="/usr/bin/chromedriver" -Dwebdriver.chrome.args="--logging-level=3" -jar selenium-server-standalone-3.7.1.jar

How could the issue be reproduced? (Steps to reproduce)

<?php
namespace Facebook\WebDriver;

include("vendor/autoload.php");

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
$host = 'http://127.0.0.1:4444/wd/hub';
$driver = RemoteWebDriver::create($host, DesiredCapabilities::chrome(), 50000);

$driver->get('http://www.seleniumhq.org/');


$driver->quit();

Details

  • Php-webdriver version: 1.5.0
  • PHP version: 7.0
  • Selenium server version: 3.7.1
  • Operating system: debian 8
  • Browser used + version: chrome 62

Most helpful comment

I have similar experience, we have to add the option even for tests of php-webdriver itself.

Refer to https://github.com/facebook/php-webdriver/commit/fda6f7f6d45ed5baa2f6ce2cd9ba3d57e165b42d for examples.

Also see https://github.com/SeleniumHQ/selenium/issues/4961 .

All 5 comments

Which version of the chromedriver are you using ?
You also probably need to pass the -enablePassThrough false option to the selenium server (like this : java -jar selenium-server-standalone-3.7.1.jar -enablePassThrough false).
If it doesn't work try using an older version of the selenium server (it works for me with version 3.6).
I hope this helps !

Still nothing.

root@user:~# php /var/www/html/sele.php
PHP Fatal error:  Uncaught Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY"}}

Operation timed out after 30001 milliseconds with 0 bytes received in /root/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:286
Stack trace:
#0 /root/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php(126): Facebook\WebDriver\Remote\HttpCommandExecutor->execute(Object(Facebook\WebDriver\Remote\WebDriverCommand))
#1 /var/www/html/sele.php(9): Facebook\WebDriver\Remote\RemoteWebDriver::create('http://127.0.0....', Object(Facebook\WebDriver\Remote\DesiredCapabilities), 50000)
#2 {main}
  thrown in /root/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php on line 286
root@user:~# screen -r
Command duration or timeout: 60.09 seconds
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
System info: host: 'user', ip: '107.150.xx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-4-amd64', java.version: '1.8.0_151'
Driver info: driver.version: ChromeDriver
2017-11-21 12:08:52.815:WARN:osjshC.ROOT:Selenium Server handling /session: org.openqa.selenium.remote.server.DriverServlet-d8355a8: Unable to send response
org.seleniumhq.jetty9.io.EofException: Closed
        at org.seleniumhq.jetty9.server.HttpOutput.write(HttpOutput.java:476)
        at java.io.OutputStream.write(OutputStream.java:75)
        at org.openqa.selenium.remote.server.DriverServlet.writeThrowable(DriverServlet.java:313)
        at org.openqa.selenium.remote.server.DriverServlet.lambda$handleRequest$0(DriverServlet.java:268)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Please provide your ChromeDriver version (chromedriver -v). Moreover, are you sure that you run the selenium server with the -enablePassThrough false ?
It seems that the issue doesn't came from the PHP bindings but from the selenium server which isn't responding.
Have you a graphical environment with your Debian ?

Add 'no-sandbox' for a workaround. It works for me.

I have similar experience, we have to add the option even for tests of php-webdriver itself.

Refer to https://github.com/facebook/php-webdriver/commit/fda6f7f6d45ed5baa2f6ce2cd9ba3d57e165b42d for examples.

Also see https://github.com/SeleniumHQ/selenium/issues/4961 .

Was this page helpful?
0 / 5 - 0 ratings