Using the API to edit functional test scripts
You can start by making some of these simple modifications to recorded Functional Test scripts:
- Change a user action, such as Object().Drag() to Object().Click().
- Delete recorded commands.
- Place an often repeated sequence of actions into a method.
- Writing messages to the log
A log is a file that contains the record of events that occur while a Functional Test script is playing back. There are several methods you can use to write messages to the log. - Modifying options for script execution
Some options that affect script execution can be specified through the user interface. Values set in the user interface persist as the defaults from script to script. You can, however, also set some of these options directly in the test script, for example, the amount of time between keystrokes. - Starting a Functional Test script from within a script
Functional Test scripts can contain methods that invoke other test scripts. You might want to take advantage of this functionality by creating a test script that serves as a command file for a suite of scripts. - Querying values of object properties
Components in the application-under-test, such as dialog boxes, command buttons, and labels, have associated pieces of information called properties. Properties have a name and a value. This topic provides some examples of why you may want to modify your script to access an object property. - Unregistering references to test objects
Helper script methods refer to an object in the application-under-test by using the test object map. Rational Functional Tester finds such mapped objects each time a method is called on the object. In some cases; however, you might not want Rational Functional Tester to do this. - Handling ambiguous recognition
In some situations during playback, Rational Functional Tester might not be able to differentiate between two like objects in the software under test. This topic describes handling these situations. - Adding manual and dynamic verification points
In addition to verification points specified during recording, you can also incorporate new verification points into a Functional Test script. Scripting manual and dynamic verification points enables you to specify data for comparison against an object that is not found in the test object map. The data, however, must be value-class based. - Handling unexpected active Windows
A common problem in GUI testing is the appearance of an unexpected active window -- for example, a warning message box in an HTML browser. This topic describes how to handle these situations. - Determining the values of cells in a table
When working with tables, you might want to extract the value of a given cell in the table. There are many ways to do this; one simple approach is to query the table directly. - Reading the Windows registry with Rational Functional Tester
The Windows registry is a database used by the Windows operating system to store configuration information. Often it becomes necessary for a tester to read information out of this database using Rational Functional Tester commands. This topic provides some examples for doing this. - Iterating through items in a tree control using the GetTestData method
This topic provides an example of using Rational Functional Tester's GetTestData method to programmatically access the values on the branches of a tree control. - Iterating through table cells using the GetTestData method
This topic provides an example of using Rational Functional Tester's GetTestData method to access the values in the cells of a grid control. - Passing parameters to the CallScript method
This topic describes how to use the different signatures of the CallScript method to pass data from one script to another. - Extracting data from a ComboBox/List control
You can use Rational Functional Tester's GetTestData method to access the values in the list of a ComboBox/List control. - Playing back low level mouse and keyboard actions
Low-level playback of mouse and keyboard actions provides more control of events of user actions. For example, Rational Functional Tester currently supports TestObject.click(), where the click consists of low-level actions including mouse move, left mouse button down, and left mouse button up. With this functionality, you can play back the individual components of a mouse click. - Searching for test objects
You can search for one or more test objects that match specified search criteria. The search is based on name/value pairs that represent properties of the test object or test objects you are looking for. The search can either be global, or limited to children of a parent test object. - Searching for SAP TestObjects
Functional Tester supports a means for locating one or more SAP TestObjects matching a specified criteria, even without using the Object Map, through scripting manually. - Tracing AJAX requests
You can test AJAX-based applications in two different ways; by setting the Auto Trace option to true or by setting the Auto Trace option to false on the corresponding document object. By setting Auto Trace option to true, you can trace the AJAX requests. - Searching for GEF objects
Rational Functional Tester recognizes the GEF EditParts and Palettes. Some Figures may not have an association with an EditPart. You can use Rational Functional Tester APIs to find such Figures as shown in the below examples. - Using dynamic find() when recording in a Notepad or Windows application
You can adapt the dynamic find() API in the Microsoft .NET integrated development environment (IDE) to obtain properties of the application under test when recording in Notepad or in a Windows platform application. - Finding the state of the browser
When you record functional test scripts, if you find that some controls were not picked up by the recording, you can verify whether the browser used during the recording was in a ready state for recording. Similarly, if you encountered problems during playback, you can verify the state of the browser. You can use the dynamic find() API and use the Html.HtmlBrowser method for this purpose. - Finding objects in a Dojo tree
You can use the dynamic find() API and the dojoTreeExpand() method to find all objects within a Dojo tree control within the application under test. - Reading multiple datapools from a functional test script
You can use the dynamic find() API to read multiple datapools from a functional test script. - Selecting an item from a Java drop-down list
You can modify the dynamic find() API to use the mapped and dynamic test objects, to select an item from a drop-down list in a Java application, as the following example illustrates: - Verifying the status of a radio button or check box
You can use the dynamic find() API to verify the status of a radio button or check box during playback, such as whether the control was selected or not. - Closing active browsers before playback
You can use the dynamic find() API to find and close all active browsers before you play back a script to ensure that there are no active browser instances before playback. - Closing unexpected HTML dialog boxes during playback
You can use the dynamic find() API to close HTML dialog boxes that are displayed unexpectedly during playback, to ensure smooth playback.
Feedback