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.

About this task

Each time you play back a script with an associated dataset, the script accesses one record in the dataset. When you create a dataset reference for a verification point, the verification point uses the dataset reference to access a variable in that record. During playback, the variable in the dataset is substituted for the dataset reference. The variable in the dataset is compared to the test results.

Procedure

  1. To play back the script, click Run Functional Test Script (Run) on the toolbar.
  2. In the Select Log window, keep the default log name Order, and then click Next.
  3. Select the Iterate Until Done option from the dataset Iteration Count list to access all the records in the dataset; then click Finish.

    HCL DevOps Test UI (Test UI) window is minimized, and the playback monitor is displayed. As the script is executed, messages are displayed in the playback monitor. Test UI plays back all of your recorded actions, such as the application starting, the actions you performed on the application, and enters data from the dataset.

    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.

  4. Close the log.

View the simplified script and the application visuals

About this task

After recording a script and playing it back, look at the Functional Test perspective in more detail.

Procedure

  1. If the Functional Test window is minimized, restore it.
    The generated simplified script is displayed in the Script editor. Functional Test perspective

    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.

  2. 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.
  3. 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.
  4. 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.
  5. Click Script to continue working with the simplified script in the script editor.

Lesson checkpoint

About this task

In this lesson you learned about the Functional Test perspective and how to play back a test script.