This version of ChromeDriver has not been tested with Chrome version 75 error with Selenium ChromeDriver and Chrome through facebook/php-webdriver

安稳与你 提交于 2020-03-03 09:27:12

问题


I'm using selenium, chromedriver, facebook/php-webdriver But the server always hang after an error What could be the problem? selenium or php?

here is the php error:

Fatal error: Uncaught Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"w3c":false,"binary":"","args":["--no-sandbox","--headless","--disable-gpu"]}}} Operation timed out after 51627 milliseconds with 0 out of -1 bytes received in /var/www/html/php-selenium/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:297 Stack trace: #0 /var/www/html/php-selenium/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php(144): Facebook\WebDriver\Remote\HttpCommandExecutor->execute(Object(Facebook\WebDriver\Remote\WebDriverCommand)) #1 /var/www/html/php-selenium/s.php(19): Facebook\WebDriver\Remote\RemoteWebDriver::create('http://localhos...', Object(Facebook\WebDriver\Remote\DesiredCapabilities), 50000, 50000) #2 {main} thrown in /var/www/html/php-selenium/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php on line 297

from selenium log:

[1561345982.225][WARNING]: This version of ChromeDriver has not been tested with Chrome version 75.
    03:13:06.892 WARN - Exception thrown
    org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
    Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
    System info: host: 'shadowsocks-server', ip: '10.140.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.21.3.el7.x86_64', java.version: '1.8.0_212'
    Driver info: driver.version: unknown

Version Info:

  • ChromeDriver 2.35.528139
  • Chrome --version Google Chrome 75.0.3770.80

+++++++++++++++++++++

updated June 29th, I have updated chromdriver to 75.0.3770.90, but the problem still persists. nothing changes.

+++++++++++++++++++++ June 30th,2019

I have solved this, with "top" command, I saw a progress whose name was kswapd0 consumed too much CPU. It is a progress which is related to swap, so I add this line to /etc/sysctl.conf: vm.swappiness=5 and got more RAM, the service has been running for a day. and no hanging any more. I didn't realize that 1.8GB RAM was not enough for chrome with default configration.


回答1:


This php error message...

Fatal error: Uncaught Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"w3c":false,"binary":"","args":["--no-sandbox","--headless","--disable-gpu"]}}} Operation timed out after 51627 milliseconds with 0 out of -1 bytes received in /var/www/html/php-selenium/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:297 Stack trace: #0 /var/www/html/php-selenium/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php(144): Facebook\WebDriver\Remote\HttpCommandExecutor->execute(Object(Facebook\WebDriver\Remote\WebDriverCommand)) #1 /var/www/html/php-selenium/s.php(19): Facebook\WebDriver\Remote\RemoteWebDriver::create('http://localhos...', Object(Facebook\WebDriver\Remote\DesiredCapabilities), 50000, 50000) #2 {main} thrown in /var/www/html/php-selenium/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php on line 297

and this selenium error message...

[WARNING]: This version of ChromeDriver has not been tested with Chrome version 75.
03:13:06.892 WARN - Exception thrown
org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException

...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.

Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • You are using chromedriver=2.35
  • Release Notes of chromedriver=2.35 clearly mentions the following :

Supports Chrome v62-64

  • You are using chrome=75.0
  • Release Notes of ChromeDriver v75.0 clearly mentions the following :

Supports Chrome version 75

So there is a clear mismatch between ChromeDriver v2.35 and the Chrome Browser v75.0


Solution

  • Upgrade ChromeDriver to current ChromeDriver v2.75 level.
  • Keep Chrome version at Chrome v75 level. (as per ChromeDriver v2.75 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.

Outro

  • Curl error thrown for http POST to /session with params: {“desiredCapabilities”:{“browserName”:“chrome”,“platform”:“ANY” with Selenium and PHPUnit
  • Facebook\WebDriver Curl error thrown for http POST to /session with params: {“desiredCapabilities”} error


来源:https://stackoverflow.com/questions/56729580/this-version-of-chromedriver-has-not-been-tested-with-chrome-version-75-error-wi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!