Tuesday, November 30, 2010

How to Calculate Transaction Time for a functional transaction with the help of QTP?

Using MercuryTimers you can find out the transaction time.



Systemutil.run "http://www.google.com"
For i=0 to 3
Browser("title:=Google").Page("title:=Google").WebEdit("name:=q","micclass:=WebEdit").Set DataTable("search_term",global)

MercuryTimers("Search").Start 
Browser("title:=Google").Page("title:=Google").WebButton("name:=Google Search","micclass:=WebButton").Click
Browser("title:=.*Google Search").Page("title:=.*Google Search").Sync
Reporter.ReportEvent micDone,"Search Time for Iteration "&i+1,""& MercuryTimers.Timer("Search").ElapsedTime/1000
MercuryTimers("Search").Stop

DataTable.SetNextRow
Browser("title:=.*Google Search").Back
MercuryTimers.Timer("Search").Reset
Next

Note:
'Create a Column "search_term"  in DataTable ( Global Sheet)
'Enter 4 different search Terms




Mercury Timer   Transaction Time   End to End Testing