Search here for all the info you want in this Blog

Transactions

Transactions are used to calculate the time taken for the particular scenario (calculating the response time)

Steps to work with Transactions:
1.Place the cursor where transaction to begin
2.Select Insert -> Start Transaction
3.Provide the transaction name -> Click on OK
4.Create the script for scenario to measure the response time
5.Place the cursor where the transaction to end
6.Select Insert -> End transaction
7.Select the transaction name from the list -> Click on OK

Eg1: Services.Start transaction “t1”
Invoke application “CALC”
Services.End transaction “t1”
The above script calculates the time taken for invoking the calculator application, which will be displayed in the results window of QTP.

Eg2: Dialog (“login”).Win edit (Agent name”).Set “Kiran”
Dialog (“Login”).Win edit (“Password).Set secure “3345hfdr234”
Dialog (“Login”).Win button (“ok”).click
Services.Start transaction “login”
IF window (“Flight reservation”).Exist (30) then
Services.End transaction “login”
End if
The above script calculates the time taking for logging in to the application.

Can we use QTP to do performance testing?
We can only calculate the response time for single user scenarios only and for the complete performance testing we should use Load Runner tool.

INTEGRATING WITH WIN RUNNER

Steps to call up WinRunner test:
1.Ensure that the Win Runner test is available
2.Select Insert -> Call to win runner test
3.Provide the test path -> Click on OK

Eg: TSL Test.Run test.exe”D:\QTP testing\WR test1”,True,False

Steps to call WinRunner Functions:

1.Ensure that the WR compile Module is available
2.Select Insert -> Call to WR Function
3.Provide the path of the compile module
4.Provide the function name -> Click the arguments in the (It automatically displays Arguments)
5.Select an Argument -> Select the type
6.Provide the value incase of type ‘In’ (or) ‘Inout’ -> Click on OK

Eg: TSL Test. Call Exe”D:\QTP Testing\w mod1”,”Calc”, true, False,”8”,”5,”c
msgbox c

No comments:

Post a Comment