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:
- Create a simple test suite ( Selenium RC only works with test suites)
- Create the command in Notepad++ and then paste into the command prompt.
- copy and paste from a browser to command line will usually not work!
- ensure you point Selenium RC to the suite and not the test script
- 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
- Create a simple test script using Selenium IDE.
- Locate the location of the Selenium Jar
- Run the Selenium Command from the Jar directory
- Notice the results file.
- Type java -version to check that java is upto date and is installed
- Type java -jar selenium-server-standalone-2.24.1.jar -help to see the command line options for Selenium RC.
- 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
- execution using Selenium RC against various different browsers
- Command line execution
- Internet explorer can play up so use the many options available via command line for selenium RC to debug.
- If you experience popup-blocker issues with Internet Explorer then popup-blocker problem. Tools >> Options >> Security >> Uncheck 'Enable Protected Mode'