In the implementation of the Keyword Framework Approach for testing a web application we can used Selenium IDE as the Record/Replay tool. Once you have the script you can then run the scripts using Selenium RC or Selenium Grid.
A typical script for automation involves a number of actions or steps on a web page. I this example we will look at automation of Google’s Gmail Login page.
Here are some of the steps
1. Open http://www.gmail.com
2. Enter “user id”
3. Enter “password”
4. Click on “login button”
To automate such a flow in a Record/Replay tool, the following steps have to be performed:
1. Open the Gmail webpage on the Firefox browser and use the Selenium IDE to record the steps mentioned above.
2. Once you have recored the script you have the option to save the script in the programing language of your choice i.e. Java, C#, PHP, Ruby.
3. The data for the script which include the element id and the test data have to be either stored in a data sheet or part of the script. The script must refer to this data sheet for relevant inputs
In writing such a script, a lot of functionality is routine, for example:
1. Opening a new browser window
2. Selecting the browser to run the test scripts.
3. Clicking on a links and entering the input data like username and password. Clicking on the login button.
4. Reading items from a data sheet, and using them as inputs for fields on the page. This can be done by creating a Object repository that reads the data from data sheets or defining the data in the object repository.