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.