Hi Hemanth, Good Morning and thanks for these valuable QTP information.
Keep mailing...
Thanks & Regards,
Satya Prakash.
----- Original Message -----From: HemanthTo: Satya PrakashSent: Saturday, April 10, 2010 10:12 PMSubject: QTP - Inserting Transaction PointsInserting Transaction PointsQTP is providing a Utility object called Services for measuring transaction timeSuppose, we want to measure how much time that one test or part of the test is taking for execution/running, we can measure using these transaction point (Start and End)Syntax:
Services.StartTransaction "Transaction Name"
Statements
-------
------
Services.EndTransaction "Transaction Name"
Note: these options (Start and End Transactions) available in QTP tool Insert menu
Example:
services.StartTransaction "Login"
SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set "naga"
Dialog("Login").WinEdit("Password:").SetSecure "4baf50f18b0ae0d5f5425fe760653e96da50bde7"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Activate
services.EndTransaction "Login"
Note: We can insert number of transaction points in a test
Using Timer Function
'Timer' is a VB Script Built-in function, that can be used for measuring transaction time.
ST=Timer' It returns elapsed time since 12:00 AM Mid night in seconds
Example:
SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set "naga"
Dialog("Login").WinEdit("Password:").SetSecure "4baf50f18b0ae0d5f5425fe760653e96da50bde7"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Activate
ET=Timer
TT=ET-ST
msgbox TT
Note: here ST, ET and TT are variables, you can take any variable, I used:
ST for Start Transaction
ET for End transaction
TT for Transaction Time
Regards,
B V Hemanth Kumar
Asst. Professor,
Department of EEE,
URCET, Telaprolu.
Mobile : (0)9392228880
Email : hemanthbolem@gmail.com
No comments:
Post a Comment
Do You LIke my Blog. Please Post a Comment so as to enable me blog better.