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

  1. Download and install latest Java JRE (if does not exist on your system)
  2. 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/
  3. Download Selenium server and start the server through following command on command line http://seleniumhq.org/download/
  4. The above steps are explained in http://www.unclecode.com/2012/05/how-to-setup-selenium-webdriver-and-execute-automation-script/
  5. Download Pear Selenium Script Package http://pear.php.net/package/Testing_Selenium/download download the file under Manual install
  6. Copy “Testing” folder in selenium pear package to your project “tests” folder
  7. Open selenium.php class file and change require_once ‘Testing/Selenium/Exception.php’; to require_once ‘Selenium/Exception.php’ in selenium.php class file
  8. 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”
  9. In tests folder write your test cases. Use example.php which can be found in Pear Selenium package download
  10. 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
  11. The above should open a new selenium firefox window to execute tests
Bookmark and Share
Both comments and pings are currently closed.

Comments are closed.