instaclick/php-webdriver
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
Instaclick/php-webdriver is a powerful tool for web testing, specifically designed to interact with Selenium 2 through the JSON Wire Protocol. This package offers an up-to-date implementation of WebDriver commands, including those yet to be documented, providing a comprehensive solution for automating web browsers. Notably, it is rooted in the master principles of Facebook's php-webdriver project by Justin Bishop, ensuring a solid foundation and familiar interface for developers. The software conforms with PSR-0 conventions for PHP 5.3+ namespaces, boasts coding style embracing PSR-1, PSR-2, and Symfony2 conventions, and facilitates API documentation auto-generation via phpDocumentor 2.x.
The usage of instaclick/php-webdriver begins with its installation. You can retrieve it from Packagist, using the command 'composer require instaclick/php-webdriver'. Once installed, you'll be able to make use of the provided classes to interact with your Selenium server. Below is a simple code example to illustrate:
require 'vendor/autoload.php';
use WebDriver\Remote\DesiredCapabilities;
use WebDriver\Remote\RemoteWebDriver;
$host = 'http://localhost:4444/wd/hub'; // this is the default
$capabilities = DesiredCapabilities::firefox();
$driver = RemoteWebDriver::create($host, $capabilities);
// navigate to 'http://docs.seleniumhq.org/'
$driver->get('http://docs.seleniumhq.org/');
// adding cookie
$driver->manage()->addCookie(array(
'name' => 'cookie_name',
'value' => 'cookie_value',
));
// delete the cookie
$driver->manage()->deleteCookieNamed('cookie_name');
$driver->quit();
In the context of the above example, WebDriver is used to start a new session (Firefox, in this case), navigate to a specified URL, and manage cookies before ending the session.
Regarding the documentation for instaclick/php-webdriver, details can be found directly on the GitHub repository (https://github.com/instaclick/php-webdriver). The 'README.md' file supplies a high-level overview of the project, but the real nitty-gritty is found within the code comments. These comments are intended to be transformed into user-friendly documentation using phpDocumentor 2.x, a standard tool for generating PHP API documentation.