Scripting Web Tests

Lab 4: Verifying Results

You’ve written some scripts that demonstrate how to automate an internet browser. But they aren’t really tests. Because they don’t really check the results. Now it is time to take care of that.

Refer to the Watir Cheat Sheet for several testing methods. The Ruby Cheat Sheet describes the syntax of an if-then statement in Ruby.

  1. Experimenting with Test Methods. In IRB, load your “start the day” test script and then experiment with different test methods to verify whether the test ran correctly. Then update the script so that it prints a message indicating whether these methods pass or fail.
  2. Start, Stop, and Verify. Revise the start, stop and pause test script so that it checks the results of each of these actions.

Don’t use the assert methods for this lab. We’ll use those in the next lab.

Solutions to Lab 3

See the following for suggested solutions to the previous lab:

  1. solutions/lab3_1.rb
  2. solutions/lab3_2.rb
  3. solutions/lab3_3.rb