Measuring transactions

Relevant for: GUI tests only

Define transactions to measure the length of time it takes to run a specific section of your test.

For example, you might want to define a transaction that measures the length of time required to both reserve a seat on a flight and to display a confirmation on the client's machine.

Define transactions in your test

Define transactions within your test by enclosing the appropriate sections of the test with Start and End transaction statements.

Define as many transactions as you need in your test, or even nested transactions, as follows:

Insert transaction-related statements

Use the Step Generator or the Editor to insert a variety of transaction-related statements.

For details, see the Services object topic in the UFT Object Model Reference for GUI Testing.

Enter Start Transaction and End Transaction steps

Use the Start and End Transaction dialog boxes. For details, see:

Note: Ensure that you only have one transaction open at a time with the same name.

If you have a transaction open, and then open a second transaction with the same name as the first, the first transaction will first end with a Fail status before the second transaction starts.

Back to top

Transactions in your run session

During the run session, the StartTransaction step signals the beginning of the time measurement. The time measurement continues until the EndTransaction step is reached.

The test results for the EndTransaction step include the transaction's name, end status, total duration, and wasted time.

Wasted time is the time within the total duration that was added as a result of UFT running the transaction, including any processes that UFT runs in the background.

Back to top

Transactions for UFT integrations

You must define transactions when integrating your test with LoadRunner, Performance Center, or the Business Process Monitor.

These products use only the data included within a transaction, and ignore any data in a test outside of a transaction.

Back to top

Sample transaction

The following image displays a sample test and transaction, as displayed in the Keyword View:

The same part of the test is displayed in the Editor as follows:

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"

Back to top