-
Notifications
You must be signed in to change notification settings - Fork 849
Description
So i installed using composer and when i try to run my script it gives error:
Fatal error: Class 'RemoteWebDriver' not found in E:\xampp\htdocs\new_job\selenium\daily.php on line 11
This is my code ;
`<?php
// An example of using php-webdriver.
require 'vendor/autoload.php';
// start Firefox with 5 second timeout
$host = 'http://localhost:4444/wd/hub'; // this is the default
//$capabilities = DesiredCapabilities::firefox();
//$driver = RemoteWebDriver::create($host, $capabilities, 5000);
$driver = RemoteWebDriver::create($host, DesiredCapabilities::firefox());
// navigate to 'http://docs.seleniumhq.org/'
$driver->get('https://www.amazon.com/gp/goldbox');
// adding cookie
$driver->manage()->deleteAllCookies();
$driver->manage()->addCookie(array(
'name' => 'cookie_name',
'value' => 'cookie_value',
));
$cookies = $driver->manage()->getCookies();
// wait at most 10 seconds until at least one result is shown
$driver->wait(10)->until(
WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(
WebDriverBy::className('top-list')
)
);
$sString = $driver->getPageSource();
// close the Firefox
$driver->quit();
print_r($sString);
?>`