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, IBM® DevOps Test UI (Test UI) changes the starting
time. When you stop a timer, Test UI writes
a message to the log that indicates the time elapsed from when the timer started. If you stop
the same timer multiple times, Test UI 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:
- If recording, click the Insert Script Support Commands button on the Recording toolbar.
- Position the pointer in the script where you want to place the
timer.
- Click the Insert Recording into Active Functional Test Script button on the product toolbar.
- Click the Insert Script Support Commands button
on the Recording
toolbar.
- Click the Timer tab in
the Script Support Functions dialog.
- 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.
- Click Insert Code.
Test UI inserts the timerStart("name")
code
at the cursor location in the script where name is the
name you entered in Start Timer: Name field.
- Perform the activity you want to time.
- Immediately after the timed activity, stop the timer:
- Click the Insert Script Support Commands button
on the Recording
toolbar.
- Click the Timer tab in the Script Support
Functions dialog.
- 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.
- Click Insert Code.
Test UI inserts the timerStop("name")
code
at the cursor location in the script where name is the
name you selected in Stop Timer: Timers field.
Note: Do
not insert a timerStop
statement before the corresponding
timerStart
statement.