Step by Step Example

Aim:
Execute Selenium RC via command line against Firefox, Chrome and Internet explorer. This is an end to end example that will show how easy it is to execute cross browser tests.

Difficulty level: Easy/Medium                                            Time to Execute : 30 mins

Tips:
  1. Create a simple test suite ( Selenium RC only works with test suites)
  2. Create the command in Notepad++ and then paste into the command prompt. 
  3. copy and paste from a browser to command line will usually not work! 
  4. ensure you point Selenium RC to the suite and not the test script
Pre-requisites:
  • Selenium IDE experience on Firefox
  • Installed Firefox , Chrome and IE. 
  • Selenium RC is downloaded ( easy to download from  http://seleniumhq.org/download/)
  • Java JRE installed
  • Can run command line (CMD) on your PC
Exercise Steps

  1. Create a simple test script using Selenium IDE.
  2. Locate the location of the Selenium Jar
  3. Run the Selenium Command from the Jar directory
  4. Notice the results file.
  5. Type java -version to check that java is upto date and is installed
  6. Type java -jar selenium-server-standalone-2.24.1.jar -help  to see the command line options for Selenium RC.
  7. Example command line entries:
Versions:
  • selenium-server-standalone-2.24.1.jar

Firefox:
java -jar selenium-server-standalone-2.0b2.jar -htmlSuite "*firefox"  "http://foundation.time2test.co.uk/"  "C:\FoundationSelenium\Ex6.1\Solution2Suite.html" "C:\FoundationSelenium\Ex6.1\Result.html"
Chrome:
java -jar selenium-server-standalone-2.0b2.jar -htmlSuite "*googlechrome"
"http://foundation.time2test.co.uk/"  "C:\FoundationSelenium\Ex6.1\Solution2Suite.html" "C:\FoundationSelenium\Ex6.1\Result.html"
Internet Explorer:
java -jar selenium-server-standalone-2.0b2.jar -htmlSuite "*iehta" "http://foundation.time2test.co.uk/" "C:\FoundationSelenium\Ex6.1\Solution2Suite.html" "C:\FoundationSelenium\Ex6.1\Result.html"


Conclusions
  1. execution using Selenium RC against various different browsers
  2. Command line execution 
  3. Internet explorer can play up so use the many options available via command line for selenium RC to debug.  
  4. If you experience popup-blocker issues with Internet Explorer then popup-blocker problem. 
    Tools >> Options >> Security >> Uncheck 'Enable Protected Mode'
Helpful Video: