Question { Siemens, 19581 }
When to Insert transactions in QTP?
Answer
we use the transaction point in QTP to find out execution
time of the script(vb script)by using the start transaction
and end transaction points
note:Transactions can be defined only for tests.
Components cannot include transactions.
Example:
Services.StartTransaction "ReserveSeat"
Browser("Welcome: Mercury Tours").Page("Find a Flight:
Mercury").WebList("fromPort").Select "London"
Browser("Welcome: Mercury Tours").Page("Find a Flight:
Mercury").WebList("toPort").Select "Frankfurt"
Browser("Welcome: Mercury Tours").Page("Find a Flight:
Mercury").WebList("toDay").Select "12"
Browser("Welcome: Mercury Tours").Page("Find a Flight:
Mercury").WebRadioGroup("servClass").Select "Business"
Browser("Welcome: Mercury Tours").Page("Find a Flight:
Mercury").WebList("airline").Select "Blue Skies Airlines"
Browser("Welcome: Mercury Tours").Page("Find a Flight:
Mercury").Image("findFlights").Click 65,12
Browser("Welcome: Mercury Tours").Page("Select a Flight:
Mercury").WebRadioGroup("outFlight").Select "Blue Skies
Airlines"
Browser("Welcome: Mercury Tours").Page("Select a Flight:
Mercury").WebRadioGroup("inFlight").Select "Blue Skies
Airlines"
Browser("Welcome: Mercury Tours").Page("Select a Flight:
Mercury").Image("reserveFlights").Click 46,8
Services.EndTransaction "ReserveSeat"
plz menction if any wrong is there in the answer