Measuring Transactions - WinRunner

You can measure how long it takes to run a section of your test by defining transactions. A transaction represents the business process that you are interested in measuring. You define transactions within your test by enclosing the appropriate sections of the test with start_transaction and end_transaction statements. For example, you can define a transaction that measures how long it takes to reserve a seat on a flight and for the confirmation to be displayed on the client’s terminal.

You must declare each transaction using a declare_transaction statement somewhere in the test prior to the corresponding start_transaction statement. You may want to declare all transactions at the beginning of your test, or you can declare each transaction immediately prior to the corresponding start_transaction statement.

During the test run, the start_transaction statement signals the beginning of the time measurement. The time measurement continues until the end_transaction statement is encountered. The test report displays the time it took to perform the transaction.

Consider the following when planning transactions:

  • There is no limit to the number of transactions that can be added to a test.
  • It is recommended to insert a synchronization point before the end of the transaction.
  • Transactions can be nested, but each start_transactionstatement must be associated with a corresponding end_transactionstatement.

You can insert declare_transaction, start_transaction, and end_transaction statements manually, or you can use the Insert Transactions options to insert these statements.

To insert transaction statements using the Insert > Transactions options:

  1. If you want to insert the declare_transaction and start_transaction statements on consecutive lines, proceed to step 4.
  2. If you want to insert the declare_transaction statement two or more lines above the start_transaction statement, place the cursor at the location where you want to declare the transaction.

  3. Choose Insert > Transactions > Declare Transaction. The Declare Transaction dialog box opens.
  4. Declare Transaction dialog box

  5. Enter a name for the transaction and click OK. The declare_transaction statement is added to your test.
  6. Place the cursor at the beginning of the line where you want the transaction measurement to begin.
  7. Choose Insert > Transactions > Start Transaction. The Start Transaction dialog box opens.
  8. Declare Transaction dialog box

  9. Enter a name for the transaction.
  10. If you have already entered a declare_transaction statement in the test, the start_transaction name should be identical to the one specified in the declare_transaction statement. Note that transaction names are case-sensitive.

  11. If you have not yet entered a declare_transaction statement for this transaction, and you want to insert the declaration on the line immediately above the start_transaction statement, select the Insert a
    declare_transaction TSL function check box.
  12. Click OK. The start_transaction (and declare_transaction, if applicable) statement(s) are added to your test.
  13. Place the cursor below the line that marks the end of the transaction measurement.
  14. Choose Insert > Transactions > End Transaction. The End Transaction dialog box opens.
  15. Start Transaction

  16. Enter the name of the transaction you want to end. The transaction name must be identical to the name used in the declare_transaction and start_transaction statements. Note that transaction names are case-sensitive.
  17. Select the pass/fail status that you want to assign to the transaction.
  18. Click OK.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

WinRunner Topics