< Previous | Next >
Lesson 6: Play back the test script
In this lesson, you play back the script and look at some parts of the application interface. Because the script you recorded is the active script, that script plays back when you click the playback button.
Each time you play back a script with an associated datapool, the script accesses one record in the datapool. When you create a datapool reference for a verification point, the verification point uses the datapool reference to access a variable in that record. During playback, the variable in the datapool is substituted for the datapool reference. The variable in the datapool is compared to the test results.
- To play back the script, click Run Functional Test Script () on the toolbar.
- In the Select Log window, keep the default log name Order, and then click Next.
- Select the Iterate Until Done option from the Datapool Iteration Count list to access all the records in the datapool; then click Finish.
IBM Rational Functional Tester window is minimized, and the playback monitor is displayed. As the script is executed, messages are displayed in the playback monitor. IBM Rational Functional Tester plays back all of your recorded actions, such as the application starting, the actions you performed on the application, and enters data from the datapool.
When playback is finished, the HTML log displays the results of the test run. Each event listed in the log includes Pass in the event headings in green.
A log is a file that contains the record of events that occur while a script is played back. A log includes the results of all verification points that are run that can be used to test the application.
- Close the log.
View the simplified script and the application visuals
After recording a script and playing it back, look at the Functional Test perspective in more detail.
- If the Functional Test window is minimized, restore it. The generated simplified script is displayed in the Script editor.
To the left of the Script editor is the Functional Test Projects view, which lists any functional test projects to which you are currently connected. All the scripts within each project are listed below the project name. This Projects view provides another way to navigate to different scripts. When you double-click a script in the Projects view, it opens in the script window and becomes the active script.
- In the script editor, click the test line Click PlaceOrder. The application visual of the PlaceOrder is displayed in the Application View. The controls of the application and their properties are captured when you record the simplified script. The application visuals are displayed in the Application View. The application visual highlights the PlaceOrder control in blue. You can click each test line in the script and view the corresponding application visual in the Application View. The Thumbnails pane in the Application View displays the application visuals of all the test scripts in the project that are captured while recording scripts. Notice that when you point the mouse over any of the thumbnails, the snapshot is zoomed and displayed.
- Move the mouse pointer over any control in the displayed application visual, right-click, and select Insert Comment to insert any comments on the control. This feature is useful when you want to check the state of the control or make a note about the control for later reference.
- Click Java editor to view the corresponding Java code of the test script. Notice that each test line of the simplified script is added as a comment to the corresponding Java code. This comment method makes it easier to map the simplified scripts and the Java code. Do not directly edit the Java code in the Java editor, because changes to the Java code are not shown in the simplified script. If you want to switch to Java scripting to use some of the functions not provided by simplified scripting, then you can use the Insert Custom Code feature and insert the required Java script.
- Click Script to continue working with the simplified script in the script editor.
In this lesson you learned about the Functional Test perspective and how to play back a test script.
< Previous | Next >