If you frequently use test automation tools, you may be familiar with the concept of testing the automation framework. Testers often look for suggestions, references, and solutions, but the framework is only half the content you need to consider. How to build your test code so that the test process for the application you are testing is most convenient, depending on the second step of the effective automation operation.
This article focuses on the first step, which helps you understand how to effectively use the tools you have. This step includes the following topics:
Objects and properties
Frequently asked questions about using browsers
Verification Point
Low-level instructions.
Script Helper Super Class
For each topic, you can find a connection to the additional information in the reference resource at the end of this article.
Attention:
The author uses the following software to write this article:
Ibm®rational®functional Tester Version 7.0.0
Microsoft®internet explorer®version 6.0.2900.2180,SP2
MICROSOFT®WINDOWS®XP PROFESSIONAL,SP2
Find alternatives to objects and their properties
Components like dialog boxes, command buttons, and labels have some information associated with them called attributes. These properties all have their own names and values. You often need to be exposed to the different properties of the object you are testing so that you can perform some type of validation, or you can follow the procedure to determine what the test script will do next. This section describes the objects, attributes, and methods that match your script.
Query and set the value of an object property
Have you ever considered dynamically comparing the previous version's value to the current value at run time? Or have you ever thought about adding a branch to your Rational functional Tester script that is based on the current value of the property contained in an object? You can retrieve the value of a property programmatically by calling the GetProperty program.
The example in code Listing 1 uses the GetProperty program to determine whether a tag contains a success message. If it is included, then you can click the OK button. If not, click the Cancel button.
Listing 1: Using the GetProperty method
if("SUCCESS".equals(dialog_htmlDialogStatic().
getProperty(".text")))
{
dialog_htmlDialogButtonOK().click();
}
else
{
dialog_htmlDialogButtonCancel().click();
}