PHP Fatal error: Uncaught Error: Class 'Facebook\WebDriver\ChromeOptions' not found

最后都变了- 提交于 2019-12-10 19:23:31

问题


namespace Facebook\WebDriver;

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

require_once('vendor/autoload.php');

$host = 'http://localhost:4444/wd/hub';

$options = new ChromeOptions();

I have read this link when i creating object of class ChromeOptions getting error

PHP Fatal error: Uncaught Error: Class 'Facebook\WebDriver\ChromeOptions' not found.


回答1:


Try this.

$options = new Chrome\ChromeOptions();



回答2:


Add

use Facebook\WebDriver\Chrome\ChromeOptions;

to the top.



来源:https://stackoverflow.com/questions/47767408/php-fatal-error-uncaught-error-class-facebook-webdriver-chromeoptions-not-fo

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