Friday, April 9, 2010

Developing Test Cases

The goal of this user guide is to help you get started writing test cases quickly. Each section describes the methods for driving a web application. Select the ones you need for each page of your web application based on the content of each page in the application.
Plan what you need to get Watir to do before you begin scripting. Open your web browser with the application under test in front of you, and pay close attention to the objects on that page. What text fields require entries? What buttons need to be pushed? What links need to be clicked on? It sometimes helps to write out the steps it will take to exercise a test first, and then filling in the Watir scripting code to satisfy each of those steps.
To start developing a test:
  • Open your text editor.
  • Name your test file with a .rb (Ruby) extension (like test.rb).
  • Provide your new test file with access to the Watir tool by entering this statement at the beginning of your test script:
require 'watir'
  • Open Internet Explorer and navigate to the application you wish to test.
  • Interact with it to design your test case.
  • Type the corresponding Watir methods into your test script.
  • Verify the results.

No comments:

Post a Comment