PHPackages                             mariopenterman/php-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. [Testing &amp; Quality](/categories/testing)
4. /
5. mariopenterman/php-webdriver

ActiveLibrary[Testing &amp; Quality](/categories/testing)

mariopenterman/php-webdriver
============================

A PHP client for Selenium WebDriver. Previously facebook/webdriver.

1.8.3(6y ago)0363MITPHPPHP ^5.6 || ~7.0

Since Sep 10Pushed 6y agoCompare

[ Source](https://github.com/mariopenterman/php-webdriver)[ Packagist](https://packagist.org/packages/mariopenterman/php-webdriver)[ Docs](https://github.com/mariopenterman/php-webdriver)[ RSS](/packages/mariopenterman-php-webdriver/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (11)Versions (31)Used By (0)

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

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

[![Latest Stable Version](https://camo.githubusercontent.com/e64903d554af29dddb1a16c0b7b6a6fc7a7baac8a1e9739ba5c439010ead0e4e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068702d7765626472697665722f7765626472697665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/php-webdriver/webdriver)[![Travis Build](https://camo.githubusercontent.com/9e9abd8ffb0119989bd2e46580167c9c823ea5c6f3c6f990ed4103d45fb18aa9/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7068702d7765626472697665722f7068702d7765626472697665722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/php-webdriver/php-webdriver)[![Sauce Test Status](https://camo.githubusercontent.com/bd99053ecd108cdb97e50ed73411aba16a5e7a90cfcc25ce4e0de68af6570bde/68747470733a2f2f73617563656c6162732e636f6d2f6275696c647374617475732f7068702d776562647269766572)](https://saucelabs.com/u/php-webdriver)[![Total Downloads](https://camo.githubusercontent.com/0905b9768e0f04b0d7ae5e83a996434ebc673f5d45250bfe1daf56ccdd5c05e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f7068702d7765626472697665722f7765626472697665722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/php-webdriver/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, 3.x and 4.x.

The library supports [JsonWireProtocol](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol) and also implements **experimental support** of [W3C WebDriver](https://w3c.github.io/webdriver/webdriver-spec.html). The W3C WebDriver support is not yet full-featured, however it should allow to control Firefox via Geckodriver and new versions of Chrome and Chromedriver with just a slight limitations.

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/).

Looking for API documentation of php-webdriver? See [https://php-webdriver.github.io/php-webdriver/](https://php-webdriver.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 php-webdriver/webdriver

```

Upgrade from version &lt;1.8.0
------------------------------

[](#upgrade-from-version-180)

Starting from version 1.8.0, the project has been renamed from `facebook/php-webdriver` to `php-webdriver/webdriver`.

In order to receive the new version and future updates, **you need to rename it in your composer.json**:

```
"require": {
-    "facebook/webdriver": "(version you use)",
+    "php-webdriver/webdriver": "(version you use)",
}
```

and run `composer update`.

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

[](#getting-started)

### 1. Start server (aka. remote end)

[](#1-start-server-aka-remote-end)

To control a browser, you need to start a *remote end* (server), which will listen to the commands sent from this library and will execute them in the respective browser.

This could be Selenium standalone server, but for local development, you can send them directly to so-called "browser driver" like Chromedriver or Geckodriver.

#### a) Chromedriver

[](#a-chromedriver)

Install the latest Chrome and [Chromedriver](https://sites.google.com/a/chromium.org/chromedriver/downloads). Make sure to have a compatible version of Chromedriver and Chrome!

Run `chromedriver` binary, you can pass `port` argument, so that it listens on port 4444:

```
chromedriver --port=4444
```

#### b) Geckodriver

[](#b-geckodriver)

Install the latest Firefox and [Geckodriver](https://github.com/mozilla/geckodriver/releases). Make sure to have a compatible version of Geckodriver and Firefox!

Run `geckodriver` binary (it start to listen on port 4444 by default):

```
geckodriver
```

#### c) Selenium standalone server

[](#c-selenium-standalone-server)

[Selenium server](https://selenium.dev/downloads/) is useful especially when you need to execute multiple tests at once or your tests are run in different browsers - like on your CI server.

Selenium server receives commands and starts new sessions using browser drivers acting like hub distributing the commands among multiple nodes.

To run the standalone server, download [`selenium-server-standalone-#.jar` file](http://selenium-release.storage.googleapis.com/index.html)(replace # with the current server version). Keep in mind **you must have Java 8+ installed**.

Run the server:

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

You may need to provide path to `chromedriver`/`geckodriver` binary (if they are not placed in system `PATH` directory):

```
# Chromedriver:
java -Dwebdriver.chrome.driver="/opt/chromium-browser/chromedriver" -jar vendor/bin/selenium-server-standalone-#.jar
# Geckodriver:
java -Dwebdriver.gecko.driver="/home/john/bin/geckodriver" -jar vendor/bin/selenium-server-standalone-#.jar

# (These options could be combined)
```

If you want to distribute browser sessions among multiple servers ("grid mode" - one Selenium hub and multiple Selenium nodes) please [refer to the documentation](https://selenium.dev/documentation/en/grid/).

#### d) Docker

[](#d-docker)

Selenium server could also be started inside Docker container - see [docker-selenium project](https://github.com/SeleniumHQ/docker-selenium).

### 2. Create a Browser Session

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

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

For example:

```
// Chromedriver (if started using --port=4444 as above)
$host = 'http://localhost:4444';
// Geckodriver
$host = 'http://localhost:4444';
// selenium-server-standalone-#.jar (version 2.x or 3.x)
$host = 'http://localhost:4444/wd/hub';
// selenium-server-standalone-#.jar (version 4.x)
$host = 'http://localhost:4444';
```

Now you can start browser of your choice:

```
use Facebook\WebDriver\Remote\RemoteWebDriver;

// Chrome
$driver = RemoteWebDriver::create($host, DesiredCapabilities::chrome());
// Firefox
$driver = RemoteWebDriver::create($host, DesiredCapabilities::firefox());
// Microsoft Edge
$driver = RemoteWebDriver::create($host, DesiredCapabilities::microsoftEdge());
```

### 3. Customize Desired Capabilities

[](#3-customize-desired-capabilities)

Desired capabilities define properties of the browser you are about to start.

They can be customized:

```
use Facebook\WebDriver\Remote\DesiredCapabilities;

$desiredCapabilities = DesiredCapabilities::firefox();

// Disable accepting SSL certificates
$desiredCapabilities->setCapability('acceptSslCerts', false);

// Run headless firefox
$desiredCapabilities->setCapability('moz:firefoxOptions', ['args' => ['-headless']]);

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

They can also be used to [configure proxy server](https://github.com/php-webdriver/php-webdriver/wiki/HowTo-Work-with-proxy) which the browser should use. To configure Chrome, you may use ChromeOptions - see [details in our wiki](https://github.com/php-webdriver/php-webdriver/wiki/ChromeOptions).

- See [legacy JsonWire protocol](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities) documentation or [W3C WebDriver specification](https://w3c.github.io/webdriver/#capabilities) for more details.

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

Changelog
---------

[](#changelog)

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

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

[](#more-information)

Some basic usage example is provided in [example.php](example.php) file.

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

You may also want to check out the Selenium [docs](https://selenium.dev/documentation/en/) 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:

- [Symfony Panther](https://github.com/symfony/panther) uses php-webdriver and integrates with PHPUnit using `PantherTestCase`
- [Laravel Dusk](https://laravel.com/docs/dusk) is another project using php-webdriver, could be used for testing via `DuskTestCase`
- [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/php-webdriver/php-webdriver/issues/new) as a new issue

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

[](#contributing)

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

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 56.7% 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.

###  Release Activity

Cadence

Every ~86 days

Recently: every ~78 days

Total

29

Last Release

2262d ago

Major Versions

v0.6.0 → 1.0.02015-06-09

PHP version history (6 changes)v0.1PHP &gt;=5.3.0

v0.2PHP &gt;=5.4.0

v0.2.1PHP &gt;=5.4.20

v0.3PHP &gt;=5.3.19

1.2.0PHP ^5.5 || ~7.0

1.5.0PHP ^5.6 || ~7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/475f1f8d42ddc99b869b7d68384698a0942475361b6bef88d6bbf7a995c5e38c?d=identicon)[mariopenterman](/maintainers/mariopenterman)

---

Top Contributors

[![OndraM](https://avatars.githubusercontent.com/u/793041?v=4)](https://github.com/OndraM "OndraM (368 commits)")[![whhone](https://avatars.githubusercontent.com/u/1200104?v=4)](https://github.com/whhone "whhone (97 commits)")[![gfosco](https://avatars.githubusercontent.com/u/406732?v=4)](https://github.com/gfosco "gfosco (52 commits)")[![cbergau](https://avatars.githubusercontent.com/u/2446617?v=4)](https://github.com/cbergau "cbergau (21 commits)")[![v-slenter](https://avatars.githubusercontent.com/u/36268710?v=4)](https://github.com/v-slenter "v-slenter (15 commits)")[![dunglas](https://avatars.githubusercontent.com/u/57224?v=4)](https://github.com/dunglas "dunglas (13 commits)")[![andrewnicols](https://avatars.githubusercontent.com/u/370047?v=4)](https://github.com/andrewnicols "andrewnicols (13 commits)")[![ashleydw](https://avatars.githubusercontent.com/u/844437?v=4)](https://github.com/ashleydw "ashleydw (9 commits)")[![mariopenterman](https://avatars.githubusercontent.com/u/7958909?v=4)](https://github.com/mariopenterman "mariopenterman (6 commits)")[![VolCh](https://avatars.githubusercontent.com/u/396345?v=4)](https://github.com/VolCh "VolCh (5 commits)")[![gkralik](https://avatars.githubusercontent.com/u/4949303?v=4)](https://github.com/gkralik "gkralik (4 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (4 commits)")[![phelipealves](https://avatars.githubusercontent.com/u/2778150?v=4)](https://github.com/phelipealves "phelipealves (4 commits)")[![okrad](https://avatars.githubusercontent.com/u/939812?v=4)](https://github.com/okrad "okrad (4 commits)")[![Lctrs](https://avatars.githubusercontent.com/u/5477973?v=4)](https://github.com/Lctrs "Lctrs (3 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (3 commits)")[![andrefortin](https://avatars.githubusercontent.com/u/26552025?v=4)](https://github.com/andrefortin "andrefortin (3 commits)")[![jonstjohn](https://avatars.githubusercontent.com/u/95620?v=4)](https://github.com/jonstjohn "jonstjohn (2 commits)")[![danielbeardsley](https://avatars.githubusercontent.com/u/26855?v=4)](https://github.com/danielbeardsley "danielbeardsley (2 commits)")[![DavertMik](https://avatars.githubusercontent.com/u/220264?v=4)](https://github.com/DavertMik "DavertMik (2 commits)")

---

Tags

phpseleniumwebdriverChromedrivergeckodriver

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[php-webdriver/webdriver

A PHP client for Selenium WebDriver. Previously facebook/webdriver.

5.2k97.4M151](/packages/php-webdriver-webdriver)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.1k](/packages/friendsofphp-php-cs-fixer)[phan/phan

A static analyzer for PHP

5.6k11.9M1.2k](/packages/phan-phan)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M734](/packages/sylius-sylius)[symfony/panther

A browser testing and web scraping library for PHP and Symfony.

3.1k16.2M142](/packages/symfony-panther)

PHPackages © 2026

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