Skip to content

textarcana/selenium_ruby_starter_kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

:title:Selenium Ruby Starter Kit

Selenium Ruby Starter Kit

ruby ts_run_all_tests.rb http://www.google.com

A set of scripts that will assist in getting up and running with Selenium RC under Ruby.

Provide setup, teardown and other utility methods for using Selenium with Test::Unit.

  1. Ruby and RubyGems must be installed on your system.

  2. The Selenium Client gem must be installed by running

    gem install selenium-client
    
  3. Download and unzip the latest version of the

Selenium RC Server. Once downloaded, start the server by double-clicking selenium-server.jar

ruby ts_run_all_tests.rb http://www.google.com

That command will launch Firefox and run the included example tests against Google.com. If you would like to run tests in MSIE or Opera instead of Firefox, browser, edit line 31 of selenium_helper.rb and change *firefox to *iexplore or *opera

One argument is expected:

  1. The root domain of the site against which to test (eg www.google.com)

  1. Delete the test_cases/google_examples directory

  2. Record a test using the Selenium IDE

  3. Once you are satisfied with your test, click on Options > Format > Ruby - Selenium RC

  4. Copy the test_new function and paste it into test_cases/tc_yours.rb

  5. Invoke ts_run_all_tests.rb, and remember to pass the full URL of the site you are testing

Remember that these scripts require Selenium Server running on port 4444.

You should be fine as long as you have double-clicked selenium-server.jar before you try running this ;-)

Be sure to supply the (sub)domain to which the site resolves. That is, if the site you are testing resolves to www.google.com, then you cannot supply google.com (without the ‘www’ subdomain) as the domain and the script will fail if you do.

This code is provided under the terms of the MIT License.

Noah Sussman, with a lot of help from Ben Strawbridge.

About

A set of scripts that will assist in getting up and running with Selenium RC on Ruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages