How can I get the value of a timer in a Visual Test? The only timer methods available are Start, Stop and Resume.

How can I get the value of a timer in a Visual Test? The only timer methods available are Start, Stop and Resume.

While there are no specific methods available to retrieve the value of the timer, we can use the Silk Test Workbench reserved variable ‘st_LastReturnValue’ which will temporarily store the value of the timer immediately after the ‘Stop Timer’ test step.

The value of the timer will be returned as type ‘Long’ in milliseconds. 

The below steps provide details on how to create a variable and store the value of the timer in the variable.

1) Create a variable to store the value by navigating to Insert -> Variable -> Add Local

 

2) Enter a name for the variable and select 'long' from the type dropdown and click OK.

3) On the 'stop timer' step perform a right click and select  Insert -> Expression

 

4) In the Expression dialog, click the output dropdown box below the text 'Put the contents of the expression into' and select the variable created in step 2.

5) On the right hand side of the Expression dialog, click the dropdown below the text 'Select a variable local or reserved' and select the item 'st_LastReturnValue'.

6) Click the 'add' button below the dropdown box

 

7) Click 'OK' button

 

During the test when the timer is stopped the value of the variable you created will now be populated with the value of timer.

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2016-05-13 18:27
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.