facebook/webdriver
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
symfony/process | v4.4.44 | - | MIT | prod |
The Facebook/WebDriver is a PHP client for Selenium WebDriver, which is a tool designed to automate web browsers. This action is particularly useful for various automated testing of real web applications in a real browser.
If you're looking to use Facebook/WebDriver, the first step is to install it. Installation is possible through Composer; a package manager that streamlines the process. If you haven't used Composer before, you can download the composer.phar
binary with the following command:
curl -sS https://getcomposer.org/installer | php
Next, you can install the Facebook/WebDriver library with this command:
php composer.phar require facebook/webdriver
Once you have started the Selenium Server, you can create a new instance of a browser session. The session must include the URL of your running server. For example, to launch Chrome, you would write:
$host = 'http://localhost:4444/wd/hub'; // this is the default
$driver = RemoteWebDriver::create($host, DesiredCapabilities::chrome());
Or for Firefox, you would write:
$driver = RemoteWebDriver::create($host, DesiredCapabilities::firefox());
Please remember that your code must have the latest versions of the browsers and their respective drivers (Chromedriver for Google Chrome and Geckodriver for Firefox) installed.
For in-depth information, some how-tos, and all-encompassing documentation on the Facebook/WebDriver, you're best off visiting the official documentation page. Besides the official documentation, you can also find a wealth of knowledge in the Selenium documentation and Selenium's GitHub wiki.