问题
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