Book Image

Advanced UFT 12 for Test Engineers Cookbook

Book Image

Advanced UFT 12 for Test Engineers Cookbook

Overview of this book

Table of Contents (18 chapters)
Advanced UFT 12 for Test Engineers Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Measuring time (MercuryTimers)


The MercuryTimers object enables measurement of time between any two operations. Unlike the native VBScript Timer function, the MercuryTimers object supports the utilization of multiple timer_name time measurement transactions in parallel. In essence, the Timers object is a kind of Dictionary that can store different Timer objects, each with a unique key. This can be useful to measure the time elapsed at different levels of the run session, and hence, identify possible bottlenecks caused by specific blocks of code.

The MercuryTimers object provides the following methods to use with a Timer object:

  • Start: This starts measuring time in milliseconds

  • Stop: This stops measuring time

  • Continue: This continues to measure time from the moment the timer stopped

  • Reset: This resets the timer to zero.

It also provides the ElapsedTime property, which can be used to report, as well as synchronization.

Getting ready

From the File menu, navigate to New | Test or use the Ctrl +...