|
Introduction
A checkpoint indicates verification of an action's result in a testing environment. Web Test Tool provides 2 type of checking:
Single property checking ( Otherwise called as a "Checkpoint")
Multiple properties checking (Otherwise called as a "Test Case")
You can also retrieve the value of a property of the web element and display or verify it. Built-in functions have been provided for the same which you can insert in the webscript during runtime.
In this tutorial, illustration has been provided for all the above types of checks. Following script illustrate the same:
Element Checkpoint Configuration
This has been illustrated in the script named "test-element-checkpoints" in the sample Payroll application. On expanding this webscript in the tree, you can see two checkpoint configurations named lang-check and comm-check.
name-check checkpoint has been designed to check if the name of the employee is "Peter Patrick". lang-check checkpoint has been designed to check if the language French has been chosen in the web page. During recording, these checkpoints were inserted as explained in the following link.
On executing the scripts, you will see that name-check
passes but lang-check fails
as "French" is not chosen. To view the results, click on Reports tab.
Table Checkpoint Configuration
This has been illustrated in the script named "test-table-checkpoint" in the sample Payroll application. On expanding this webscript in the tree, you can see two checkpoint configurations named if-peter-present and if-mary-present.
if-peter-present checkpointhas
been designed to check if the value at
the cell 3,2 in the displayed table contains the employee name Peter Warting.
if-mary-present checkpoint has
been designed to check if the value at
the cell 4,2 in the displayed table contains the employee name Mary.
During recording, these checkpoints were inserted as explained in the following link.
On executing the scripts, you will see that if-peter-present
check passes but if-mary-present
check fails as "Mary" is not found in the specified cell.
To view the results, click on Reports
tab.
Testing Checkpoints and Retrieve Data functions
This has been illustrated in the script named "test-checkpoints-getdata" in the sample Payroll application. Notice the functions editGetInfo(), buttonCheckInfo(), pageGetInfo() etc
used displayMessage() will display the result in the logs panel and log files.
reportStatus() will show the result in web reports.
This has been illustrated in the script named "test-static-substitution" in the sample Payroll application. This checks if the entered date is before the current date.
|