Getting started with selenium

mkirank on 2007-02-14T03:01:41


Version Details

Active Perl version 5.8.7
Firefox 1.5.0.9
Selenium RC 0.9.0






Installation
1. Install Java 1.5
2. Install Alien-SeleniumRC via ppm
3. Install Test-WWW-Selenium via ppm
4. Install the selenium-IDE firefox extension
5. Install the xpath checker



Creating tests
1. Using selenium IDE create tests (helpful to some extent in generating the code) ,
       and save the tests . Do not forget to set the format to perl in Options->format
2. Start the selenium server I have manually installed Selenium RC so I go to the directory (Alien-SeleniumRC has a script)
, If you want to work with frames start selenium with a -multiWindow option (eg: java -jar selenium-server.jar -multiWindow)
3.Run your tests

Xpath Checker is used to get the Xpath

Example: $sel->click_ok("xpath=/html/body/table[2]/tbody/tr/td/form/table/tbody/tr[9]/td[3]/a");

For Pugs like setup which displays the results in HTML

1. Install Method::Alias via ppm (required for Test-TAP-Model)
2. Download and install from CPAN (via commandline could not find ppm) Test-TAP-Model-0.06
3. Install Petal via PPM (required for Test-TAP-HTMLmatrix)
4. Install Petal-utils via PPM (required for Test-TAP-HTMLmatrix)
5. Download and install from CPAN Test-TAP-HTMLMatrix-0.05 (commandline Install)
6. Install YAML via ppm
7. Install Html-Template via ppm
8. Install Regexp-Common via ppm
9. Install Best.pm



get the following scripts from the Pugs repository
run-smoke.pl
yaml_harness.pl
testgraph.pl
catalog_tests.pl
catalog_tmpl

run the run-smoke.pl /some/sandbox/dir with selenium tests /some/www/file.html
For Data Driven Tests Luke Closs has written some Modules

Check out Wiki Tests