# Scripting Web Tests

with Watir and Ruby

Workbook / Labs / 2. Using the Ruby Shell

## Lab 2: Driving Web Applications using IRB

You have seen a demonstration of how to drive the web application using Watir and IRB. Now it is your turn. Enter Watir commands into IRB to drive the Timeclock application.

Use the Watir Cheat Sheet, Using IRB and Watir, and the Watir User Guide as references.

We suggest that you execute the following steps:

1. Log into the timeclock server using an existing account.
2. Create a new job.
3. Start the new job.
4. Stop the day.

You will need to have Ruby and the Web Testing with Ruby toolkit installed on your machine before starting.

### Completion

When you have completed this lab, you should be able to:

- Start IE from IRB
- View the fields and buttons on a page
- Select an element by name, value or id
- Enter text in a text field
- Click a button