Requirement: We are using
- Wamp 2.4 64 bit edition
- PHP 5.4.12
- Apache 2.4.4
Steps 1: Install wamp
- Download & install Wamp http://www.wampserver.com
Step 2: Install Curl
- Activate Curl extension in wamp. Wamp >> PHP >> PHP Extension >> Check php_curl
- Restart wamp
Step 3: Install Pear
- Go to http://pear.php.net/go-pear.phar and save the file to your computer. I saved to C:\wamp\bin\php\php5.4.12.
- Start menu > Within the search bar type ”cmd” > right-click cmd.exe > Run as administrator
- Navigate to the folder you saved go-pear.phar by typing> “cd C:\wamp\bin\php\php5.4.12?
- Type “php go-pear.phar”
- When executing above command, it will ask you a series of question to set itself up correctly, if you don’t know what to do, then just accept the defaults. But if you are using more than one version of PHP, then select “local” in [system/local] wide copy configuration.
- You can check the information of pear from any of the command.
C:\wamp\bin\php\php5.4.12>pear info pearC:\wamp\bin\php\php5.4.12>pear -V
- Once installed you must run the PEAR_ENV.reg which will create the environment variables for the user, so that PEAR can be called in any directory on the command line.C:\wamp\bin\php\php5.4.12>PEAR_ENV.regIf you cannot call PEAR from the command prompt, then you must manually add
directory to the path in the System Environment Variables list, then add the directory
“C:\wamp\bin\php\php5.2.8” to the ‘PATH’ & ‘INCLUDE_PATH’ variable. Or double click on the file
“PEAR_ENV.reg” in PHP folder, it’ll register the environment variables in system.
Step 4: PHPUnit with Selenium RC integration
- Download all the packages that you need to install from http://pear.php.net/ I downloaded following packages PHPUnit2-2.3.6.tgz, Testing_Selenium-0.4.4.tgz, Benchmark-1.2.9.tgz( Benchmark is dependency for php unit, without installting benchmark you cannot install PHPUnit
- I copied all the packages to PHP directory C:\wamp\bin\php\php5.4.12
- Install Benchmark first by typing pear install Benchmark-1.2.9.tgz
- Install PHP Unit by typing pear install PHPUnit2-2.3.6.tgz
- Install Selenium by typing install Testing_Selenium-0.4.4.tgz
- Restart Wamp
Step 5: Download Selenium
- Go to http://seleniumhq.org/download/ and download the “Selenium server” jar file.
- Within a new cmd window type “java -jar pathtoselenium-server.jar”.