Insert transactions in scripts
A transaction measures the time between two points in a business process. This topic describes how to use transactions in your TruClient 2.0 - Web scripts.
About using transactions
Transactions can help you analyze the time it takes the Vuser to perform different sections of the process. For example, a transaction might start when sending credit card information, and end when receiving authorization.
Transactions in your script can overlap, or you can create transactions within other transactions.
Most transactions relate to a series of consecutive steps. However, transactions do not need to be sequential. You can use the same transaction name in different sections of the script, to join the time measurements of actions that do not directly follow one after the other. To use the same transaction name in different places, use the TC.startTransaction(name) and TC.endTransaction(name, status) functions. For details, see Web Vuser functions in the Function Reference.
Add transactions
You can use the context menu or the Transactions editor to add transactions to your script. You can also use the Transactions editor to edit and delete transactions.
Note: If you add a Transaction step before/after a level 2 or 3 step, and then change the level display so that step is hidden, the Transaction step remains in your script. You must reassign the Transaction step in the Transactions editor.
For details on the levels, see Step levels.
To add a transaction using the context menu:
-
Select one or more steps in your script. For multiple steps, make sure the start and end steps for the transaction are selected.
-
Right-click to open the context menu and select Surround with transaction.
-
Enter a unique transaction name.
-
Click OK. The Start transaction and End transaction steps are added above and below the selected steps.
To add and edit transactions using the Transactions editor:
-
Click the Transactions editor button
in the Development window Toolbar, or in a Transaction step, to open the editor.
-
Define a unique transaction name.
-
Select the required Start step and End step for the transaction from the dropdown lists.
Note: Make sure the Start step is earlier than the End step.
- Click Save. The Transaction steps are added to the script.
See also: