PHPackages                             vereschak/webdriver - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. vereschak/webdriver

ActiveLibrary[API Development](/categories/api)

vereschak/webdriver
===================

A PHP client for Selenium WebDriver

09PHP

Since Apr 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Vereschak/facebook-driver)[ Packagist](https://packagist.org/packages/vereschak/webdriver)[ RSS](/packages/vereschak-webdriver/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-webdriver – Selenium WebDriver bindings for PHP
===================================================

[](#php-webdriver--selenium-webdriver-bindings-for-php)

[![Latest Stable Version](https://camo.githubusercontent.com/df2e1fa9c40cbdaf7287ca1024f4a1ef69fbbcb5abf42ae8ea6718532fcca9de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66616365626f6f6b2f7765626472697665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/facebook/webdriver)[![Travis Build](https://camo.githubusercontent.com/2dde2a6e8b91fc8a98202b926a1bc8643423ed974fe5c7783b12efe727c18c87/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f66616365626f6f6b2f7068702d7765626472697665722f636f6d6d756e6974792e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/facebook/php-webdriver)[![Sauce Test Status](https://camo.githubusercontent.com/bd99053ecd108cdb97e50ed73411aba16a5e7a90cfcc25ce4e0de68af6570bde/68747470733a2f2f73617563656c6162732e636f6d2f6275696c647374617475732f7068702d776562647269766572)](https://saucelabs.com/u/php-webdriver)[![Total Downloads](https://camo.githubusercontent.com/28cf482358b8d681b22784404fb5a720d63f1e282d976618f440513b840d4910/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66616365626f6f6b2f7765626472697665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/facebook/webdriver)[![License](https://camo.githubusercontent.com/e5c1c64de7bf591b88306db6170e758732d17eb30d284cd53d3cd0679d291688/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f66616365626f6f6b2f7765626472697665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/facebook/webdriver)

Description
-----------

[](#description)

Php-webdriver library is PHP language binding for Selenium WebDriver, which allows you to control web browsers from PHP.

This library is compatible with Selenium server version 2.x and 3.x. It implements the [JsonWireProtocol](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol), which is currently supported by the Selenium server and will also implement the [W3C WebDriver](https://w3c.github.io/webdriver/webdriver-spec.html) specification in the future.

The concepts of this library are very similar to the "official" Java, .NET, Python and Ruby bindings from the [Selenium project](https://github.com/SeleniumHQ/selenium/).

**As of 2013, this PHP client has been rewritten from scratch.**Using the old version? Check out [Adam Goucher's fork](https://github.com/Element-34/php-webdriver) of it.

Looking for API documentation of php-webdriver? See [https://facebook.github.io/php-webdriver/](https://facebook.github.io/php-webdriver/latest/)

Any complaints, questions, or ideas? Post them in the user group .

Installation
------------

[](#installation)

Installation is possible using [Composer](https://getcomposer.org/).

If you don't already use Composer, you can download the `composer.phar` binary:

```
curl -sS https://getcomposer.org/installer | php

```

Then install the library:

```
php composer.phar require facebook/webdriver

```

Getting started
---------------

[](#getting-started)

### Start Server

[](#start-server)

The required server is the `selenium-server-standalone-#.jar` file provided here:

Download and run the server by replacing # with the current server version. Keep in mind **you must have Java 8+ installed to run this command**.

```
java -jar selenium-server-standalone-#.jar

```

**NOTE:** If using Firefox, see alternate command below.

### Create a Browser Session

[](#create-a-browser-session)

When creating a browser session, be sure to pass the url of your running server.

```
// This would be the url of the host running the server-standalone.jar
$host = 'http://localhost:4444/wd/hub'; // this is the default
```

##### Launch Chrome

[](#launch-chrome)

Make sure to have latest Chrome and [Chromedriver](https://sites.google.com/a/chromium.org/chromedriver/downloads) versions installed.

```
$driver = RemoteWebDriver::create($host, DesiredCapabilities::chrome());
```

##### Launch Firefox

[](#launch-firefox)

Make sure to have latest Firefox and [Geckodriver](https://github.com/mozilla/geckodriver/releases) installed.

Because Firefox (and Geckodriver) only support the new W3C WebDriver protocol (which is yet to be implemented by php-webdriver - see [issue #469](https://github.com/facebook/php-webdriver/issues/469)), the protocols must be translated by Selenium Server - this feature is *partially* available in Selenium Server versions 3.5.0-3.8.1 and you can enable it like this:

```
java -jar selenium-server-standalone-3.8.1.jar -enablePassThrough false

```

Now you can start Firefox from your code:

```
$driver = RemoteWebDriver::create($host, DesiredCapabilities::firefox());
```

### Customize Desired Capabilities

[](#customize-desired-capabilities)

```
$desired_capabilities = DesiredCapabilities::firefox();
$desired_capabilities->setCapability('acceptSslCerts', false);
$driver = RemoteWebDriver::create($host, $desired_capabilities);
```

- See  for more details.

**NOTE:** Above snippets are not intended to be a working example by simply copy-pasting. See [example.php](example.php) for working example.

Changelog
---------

[](#changelog)

For latest changes see [CHANGELOG.md](CHANGELOG.md) file.

More information
----------------

[](#more-information)

Some how-tos are provided right here in [our GitHub wiki](https://github.com/facebook/php-webdriver/wiki).

You may also want to check out the Selenium [docs](http://docs.seleniumhq.org/docs/) and [wiki](https://github.com/SeleniumHQ/selenium/wiki).

Testing framework integration
-----------------------------

[](#testing-framework-integration)

To take advantage of automatized testing you may want to integrate php-webdriver to your testing framework. There are some projects already providing this:

- [Steward](https://github.com/lmc-eu/steward) integrates php-webdriver directly to [PHPUnit](https://phpunit.de/), and provides parallelization
- [Codeception](http://codeception.com) testing framework provides BDD-layer on top of php-webdriver in its [WebDriver module](http://codeception.com/docs/modules/WebDriver)
- You can also check out this [blogpost](http://codeception.com/11-12-2013/working-with-phpunit-and-selenium-webdriver.html) + [demo project](https://github.com/DavertMik/php-webdriver-demo), describing simple [PHPUnit](https://phpunit.de/) integration

Support
-------

[](#support)

We have a great community willing to help you!

- **Via our Facebook Group** - If you have questions or are an active contributor consider joining our [facebook group](https://www.facebook.com/groups/phpwebdriver/) and contribute to communal discussion and support
- **Via StackOverflow** - You can also [ask a question](https://stackoverflow.com/questions/ask?tags=php+selenium-webdriver) or find many already answered question on StackOverflow
- **Via GitHub** - Another option if you have a question (or bug report) is to [submit it here](https://github.com/facebook/php-webdriver/issues/new) as an new issue

Contributing
------------

[](#contributing)

We love to have your help to make php-webdriver better. See [CONTRIBUTING.md](CONTRIBUTING.md) for more information about contributing and developing php-webdriver.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6950514be5c223e75f672094d9c60467d390dfb86b16caed088ed70d4afb125b?d=identicon)[Vereschak](/maintainers/Vereschak)

---

Top Contributors

[![Vereschak](https://avatars.githubusercontent.com/u/6361527?v=4)](https://github.com/Vereschak "Vereschak (8 commits)")

### Embed Badge

![Health badge](/badges/vereschak-webdriver/health.svg)

```
[![Health](https://phpackages.com/badges/vereschak-webdriver/health.svg)](https://phpackages.com/packages/vereschak-webdriver)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
