Mercury Timer object is a internal timer object that measures the amount of time in milliseconds.
Mercury Timer Methods
Continue Method - Continue counting
Reset Method - Reset timer
Start Method - Starts Timer
Stop Method - Stops Timer
Mercury Timer Property
ElapsedTime Property
Example -MercuryTimers("Timer1").StartWait 2MercuryTimers("Timer1").Stopprint MercuryTimers("Timer1").ElapsedTimeThus we can find the elapsed time in milliseconds using mercury timer object.
- ###############################################
- ' Mercury Timers & Timer Object
- '###############################################
- 'Purpose - To Create a Timer which will work like a stop watch
- 'We can create multiple Timers using Mercury Timers Object.
- 'Every Timer can be controlled by Timer Object
- ' It has some facilities to start, stop, continue and reset the Timers
- MercuryTimers("Timer1").Start 'Start measuring time using Timer1.
- Wait 1
- MercuryTimers("Timer1").Stop 'After one second, stop Timer1.
- MercuryTimers("Timer2").Start 'Start measuring time usingTimer2.
- 'Two seconds later, restart Timer1 (which will continue to measure time from
- 'the time it stopped while Timer2 continues uninterrupted).
- Wait 2
- MercuryTimers("Timer1").Continue
- 'Three seconds later, stop both timers and send a report to the test
- 'results specifying the elapsed time for each of the timer objects
- '(Timer1 ~4000 ms; Timer2 ~5000 ms).
- Wait 3
- Reporter.ReportEvent micInfo, "Elapsed Time", "Timer1: " & MercuryTimers("Timer1").Stop() & "ms, Timer2: " & MercuryTimers("Timer2").Stop() & "ms"
- 'Set a transaction manually for each of the timer objects. Convert the
- 'elapsed time for each of the timer objects from milliseconds to seconds so
- 'the elapsed time will be reported correctly in the transaction.
- Services.SetTransaction "Timer1",MercuryTimers("Timer1").ElapsedTime / 1000,Pass
- Services.SetTransaction "Timer2",MercuryTimers("Timer2").ElapsedTime / 1000,Pass
Pages
- Training Details
- Manual + QTP + Selenium
- QTP Scripting for BEGINNERs
- QTP INTERMEDIATE
- EXPERT QTP
- VB Script
- Encrypting a String in QTP
- QTP Scripts
- QTP questions and answers
- Selenium Code Links
- Selenium Framework
- Java OOPs Concepts
- JDBC Connection
- TestNG Build.xml code
- pom.xml
- CONFIGURE ECLIPSE WITH CUCUMBER
- SQL Commands
- EVENT LISTENERS IN SELENIUM WEBDRIVER
- ContactUs
Total Pageviews
Wednesday, 24 September 2014
Mercury Timers Object
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment