Selenium On Rails

Getting Started

Selenium on Rails is the name of the Selenium product crafted specifically for Rails
developers and is distributed as a Rails plugin. It has been designed to work seamlessly
with the Rails testing environment and fixtures.

It’s easy to install Selenium on Rails and get started.

1. Install the core Selenium files needed by the plugin:

SAMPLE>gem install selenium

2. Install the Selenium on Rails plugin for a given project:

SAMPLE>ruby  script/plugin install http://svn.openqa.org/svn/selenium-on-rails/selenium-on-rails/

3. Generate the test directory and a test script:

SAMPLE>ruby script/generate selenium first.rsel

4. Start your Rails server in its test environment:

SAMPLE>ruby script/server -e test

5. Open the Selenium Test Runner in your browser:

http://localhost:3000/selenium

If your installation and setup succeeded, you see the Selenium Test Runner in your browser. You should also know that Selenium tests can be run from the command line and integrated into an automated suite of tests, but for demonstration purposes we will use the built-in web interface to execute our tests.

SAMPLE/test/selenium/first.rsel

setup
open ‘/’
assert_title ‘Ruby on Rails: Welcome aboard’
Run test in –> http://localhost:3000/selenium

For more reference –> http://seleniumhq.org/

Regards,

P.Raveendran

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s