doulao3905 2018-06-18 20:10
浏览 45

硒的卷曲错误

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

I have got this error. Platform Linux, OS Ubuntu 16.04. Php script:

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);

I have been installed Google Chrome latest version and chromedriver latest version for linux 64.

I was run selenium with this code:

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
  • 写回答

1条回答 默认 最新

  • dongxu1029 2018-06-23 10:56
    关注

    I fix error:

    $options = new 
    \Facebook\WebDriver\Chrome\ChromeOptions();
    $options->addArguments(array(
        '--no-sandbox',
    ));
    

    Also I changed webdriver to 2.29 and put it into /usr/local/bin with executable permission.

    I changed running Xvfb to

    Xvfb :99 -screen 0 1280x1024x24 -ac &
    

    And than

    export DISPLAY=:99 && java -Dwebdriver.chrome.driver="/usr/local/bin/chromedriver-229" -jar /usr/local/bin/selenium-server.jar
    

    Now, it working good.

    评论

报告相同问题?

悬赏问题

  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)