Home arrow Ruby-on-Rails arrow Recording Acceptance Tests
RUBY-ON-RAILS

Recording Acceptance Tests


In this conclusion to a three-part article series on acceptance testing with Ruby on Rails, you'll learn how to use the Selenium IDE and how (and why) to record the results of your acceptance tests. This article is excerpted from chapter 11 of the book Practical Rails Projects, written by Eldon Alameda (Apress; ISBN: 1590597818).

Author Info:
By: Apress Publishing
Rating: 5 stars5 stars5 stars5 stars5 stars / 2
July 30, 2010
TABLE OF CONTENTS:
  1. · Recording Acceptance Tests
  2. · Recording the View Forum Acceptance Test
  3. · Recording the Post to Forum Acceptance Test
  4. · Recording the Show Post Acceptance Test
  5. · Recording the Reply to Post Acceptance Test

print this article
SEARCH DEVARTICLES

Recording Acceptance Tests
(Page 1 of 5 )

Using the Selenium IDE

Selenium IDE allows you to record your tests directly in the browser. You simply click the record button and perform the actions in your browser. Selenium IDE also allows you to run and debug tests. These features are all made possible by the inclusion of Selenium Core in the extension. On top of this, Selenium IDE provides you with features like autocompleting commands and saving recorded tests as HTML, Ruby, or other any other user-defined format.

The Selenium IDE project is hosted, like Selenium itself, at www.openqa.com. Install Selenium IDE by going to http://www.openqa.org/selenium-ide/ and accessing the Selenium IDE Downloads page, as shown in Figure 11-2.


Figure 11-2.  The Selenium IDE Downloads page

Firefox requires that you allow www.openqa.org to install extensions on your machine. So, your first step is to click the Edit Options button at the top left of the Selenium IDE Downloads page (see Figure 11-2) and add www.openqa.org to the list of privileged sites.

Next, click the Download link again. This time, you should see the dialog box shown in Figure 11-3. To continue with the installation, click the Install button.

After restarting Firefox, you can open Selenium IDE by selecting Tools -> Selenium IDE from the browser menu bar. You should now see the Selenium IDE window, as shown in Figure 11-4.


Figure 11-3.  Installing the Selenium IDE extension


Figure 11-4.  The Selenium IDE window

The Selenium IDE window has two tabs:

  1. The Table tab is where the recorded commands are shown. Right-click a row to see a context-sensitive pop-up menu that allows you to insert new commands, delete existing commands, and perform other actions. 
     
  2. The Source tab is where the actual source for the acceptance test is shown. You can either copy and paste the code or use the File -> Save Test menu item to save the test to a file. You can switch between different supported output formats by selecting the appropriate option from the Options -> Format menu.


blog comments powered by Disqus
RUBY-ON-RAILS ARTICLES

- Ruby-on-Rails Faces Second Security Flaw in ...
- Ruby 2.0 Prepped for February 2013 Release
- Why LinkedIn Switched from Ruby on Rails
- Adding Style with Action Pack
- Handling HTML in Templates with Action Pack
- Filters, Controllers and Helpers in Action P...
- Action Pack and Controller Filters
- Action Pack Categories and Events
- Logging Out, Events and Templates with Actio...
- Action Pack Sessions and Architecture
- More on Action Pack Partial Templates
- Action Pack Partial Templates
- Displaying Error Messages with the Action Pa...
- Action Pack Request Parameters
- Creating an Action Pack Registration Form

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials