Use timers with functional test scripts

You can insert any number of timers with different names into the same script to measure the time it takes to perform a variety of separate tasks. You can nest timers within other timers (starting and stopping the second timer before stopping the first timer), and you can overlap timers (stopping the second timer after stopping the first timer).

However, you should stop a timer before starting that same timer again. If you start the same timer again, Functional Tester changes the starting time. When you stop a timer, Functional Tester writes a message to the log that indicates the time elapsed from when the timer started. If you stop the same timer multiple times, Functional Tester does not restart the timer. You should call timerStart if you want to restart the timer.

When you play back a script that includes timers, you can view the elapsed time in the log.

To insert a timer while recording or editing a script:


Procedure

  1. If recording, click the Insert Script Support Commands button on the Recording toolbar.

    If editing:

    1. Position the pointer in the script where you want to place the timer.

    2. Click the Insert Recording into Active Functional Tester Script button on the Functional Tester toolbar.

    3. Click the Insert Script Support Commands button on the Recording toolbar.

  2. Click the Timer tab in the Script Support Functions dialog box.

  3. In the Start Timer: Name field, type a timer name. If you start more than one timer, make sure you give each timer a different name.

  4. Click Insert Code.

    Functional Tester inserts the timerStart("name")code at the cursor location in the script where name is the name you entered in Start Timer: Name field.

  5. Perform the activity you want to time.

  6. Immediately after the timed activity, stop the timer:

    1. Click the Insert Script Support Commands button on the Recording toolbar.

    2. Click the Timer tab in the Script Support Functions dialog box.

    3. In the Stop Timer: Timers field, select from the list the timer that you want to stop.

      If you do not see the timer name in the list, type the name in the combo box.

    4. Click Insert Code.

      Functional Tester inserts the timerStop("name") code at the cursor location in the script where name is the name you selected in Stop Timer: Timers field.

      Do not insert a timerStop statement before the corresponding timerStart statement.

Related tasks

Calling a script from a functional test script

Insert a log message into a functional test script

Setting delays and sleep states for functional test script playback

Insert comments into a functional test script

Insert clipboard commands into a functional test script

+

Search Tips   |   Advanced Search