我正在尝试打开 Firefox,因为示例在此处https://github.com/facebook/php-webdriver/blob/community/example.php
使用以下代码进行了说明:
<?php
namespace Facebook\WebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
require_once 'C:\Users\alex\vendor\autoload.php';
$host = 'http://localhost:44441/wd/hub'; // i am running on 44441
$capabilities = DesiredCapabilities::firefox();
$driver = RemoteWebDriver::create($host, $capabilities, 5000);
?>
我在 \alex\vendor\ 的 composer composer.json 看起来像这样:
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit95fa64adf2a94f75qbb05d3ee5a8af4e::getLoader();
我的 composer.json 看起来像这样:
{
"require": {
"facebook/graph-sdk": "^5.6"
}
}
我的错误是:
PHP Fatal error: Uncaught Error: Class
'Facebook\WebDriver\Remote\DesiredCapabilities' not found in
C:\Users\alex\Desktop\php-webdriver-community\hello.php:11
Stack trace:
#0 {main}
thrown in C:\Users\akal\Desktop\php-webdriver-community\hello.php on line 11
[Finished in 0.0s]
谁能帮忙?