Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A php client for webdriver.
Latest commit 9533da5 @gfosco gfosco Merge pull request #261 from WanderingZombie/patch-1
add missing single quotes

php-webdriver -- WebDriver bindings for PHP


This WebDriver client aims to be as close as possible to bindings in other languages. The concepts are very similar to the Java, .NET, Python and Ruby bindings for WebDriver.

Looking for documentation about php-webdriver? See

The PHP client was rewritten from scratch. Using the old version? Check out Adam Goucher's fork of it at

Any complaint, question, idea? You can post it on the user group


There are two ways of getting the code:

Via Github

git clone

Via Packagist

Add the dependency to composer.json (see

  "require": {
    "facebook/webdriver": "~1.0"


Download the composer.phar

curl -sS | php

Install the library.

php composer.phar install


  • All you need as the server for this client is the selenium-server-standalone-#.jar file provided here:

  • Download and run that file, replacing # with the current server version.

    java -jar selenium-server-standalone-#.jar
  • Then when you create a session, be sure to pass the url to where your server is running.

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

    $driver = RemoteWebDriver::create($host, DesiredCapabilities::firefox());
  • Launch Chrome

    $driver = RemoteWebDriver::create($host, DesiredCapabilities::chrome());
  • You can also customize the desired capabilities.

    $desired_capabilities = DesiredCapabilities::firefox();
    RemoteWebDriver::create($host, $desired_capabilities);
  • See for more details.


To run unit tests simply run:

./vendor/bin/phpunit -c ./tests

Note: For the functional test suite, a running selenium server is required.


Check out the Selenium docs and wiki at and

Learn how to integrate it with PHPUnit Blogpost | Demo Project


We have a great community willing to try and help you!

Currently we offer support in two manners:

Via our Facebook Group

If you have questions or are an active contributor consider joining our facebook group and contributing to the communal discussion and support

Via Github

If you're reading this you've already found our Github repository. If you have a question, feel free to submit it as an issue and our staff will do their best to help you as soon as possible.


We love to have your help to make php-webdriver better. Feel free to

When you are going to contribute, please keep in mind that this webdriver client aims to be as close as possible to other languages Java/Ruby/Python/C#. FYI, here is the overview of the official Java API

Something went wrong with that request. Please try again.