Executing and Creating Selenium RC automation test cases using Pear Selenium package

June 4th, 2012

Garry
- Download and install latest Java JRE (if does not exist on your system)
- Make sure you have installed PHP and its path is set in your environment so that you can execute php through command prompt. For reference check step 3 and 4 of article http://www.unclecode.com/2010/05/install-phpunit-on-wamp-xamp-manually-without-pear/
- Download Selenium server and start the server through following command on command line http://seleniumhq.org/download/
- The above steps are explained in http://www.unclecode.com/2012/05/how-to-setup-selenium-webdriver-and-execute-automation-script/
- Download Pear Selenium Script Package http://pear.php.net/package/Testing_Selenium/download download the file under Manual install
- Copy “Testing” folder in selenium pear package to your project “tests” folder
- Open selenium.php class file and change require_once ‘Testing/Selenium/Exception.php’; to require_once ‘Selenium/Exception.php’ in selenium.php class file
- Download Pear package from http://pear.php.net/package/PEAR/download/, extract the files copy the PEAR folder which includes Exception class required by Selenium.php class file and paste it in Selenium folder like “\Testing\Selenium\PEAR”
- In tests folder write your test cases. Use example.php which can be found in Pear Selenium package download
- Open another command prompt other than the one in which selenium is running and go to the path where example.php is saved and execute the following command-
C:\wamp\www\php-selenium-webdriver\tests>php example.php
- The above should open a new selenium firefox window to execute tests

You can
leave a response, or
trackback from your own site.
Leave a Reply