Setup Selenium Web driver on WAMP environment

Recently I configured Selenium web driver on multiple systems having WAMP environment. There’s an excellent tutorial for it here. However I had to do some additional configurations mentioned below.

Step 2.1 mentioned there is a bit tricky, you may have to try these

pear clear-cache

pear install -a -f phpunit/PHPUnit


pear install –force phpunit/PHPUnit_Selenium


Also make sure that cURL is working. You may have to replace your curl extension file

Also WAMP contains multiple php.ini files

  1. /wamp/bin/php/php5.x.x
  2. /wamp/bin/apache/apache2.x.x/bin

Make sure to enable cURL in both the files so that PHP CLI picks the cURL extension

Integrate Web Driver

Selenium Webdriver doesn’t support PHP. However there are several third party implementations. I prefer Download the repo and copy the lib folder in your tests folder. Here’s a sample file that you can use to verify your installation



class First extends PHPUnit_Framework_TestCase {

protected function setUp() {
$host = 'http://localhost:4444/wd/hub'; // this is the default
$capabilities = array(WebDriverCapabilityType::BROWSER_NAME => 'firefox');
$this->driver = RemoteWebDriver::create($host, $capabilities, 1000);

public function testLogin(){



Run command “phpunit first.php First”. This would open a firefox window and navigate to http://localhost/mysite/.

Extend the script using both the Selenium webdriver API and PHP Unit assertions.

I am a web developer working @ Gaditek

Tagged with: , , , , , ,
Posted in PHP, Programming & Development

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

About me
A geek trying to make world a better place to live.

I work on LAMP Stack, SRE and resilience engineering. I also worked on Python, GAE and Netsuite Customization. Currently working @ Cloudways as Software Architect

Profile Links Linkedin | Github | Stackoverflow
Subscribe to this blog
%d bloggers like this: