Insert transactions

A transaction measures the time between two points in a business process. This topic describes how to use transactions in your scripts.

Note: Support for adding start and end points to a transaction will be deprecated in upcoming versions of TruClient. We recommend using End events instead. For details, see End events.

About using transactions

Add transactions so that you can analyze the time spent in different sections of the process after running the test.

For example, a transaction might start when sending credit card information and end when receiving authorization.

Transaction start and end are linked not only to a start step and end step, but to events you specify within the steps. Therefore, a transaction does not necessarily begin at the start of a step or end at the end of a step.

When you delete a step that contains a transaction start, the transaction start is moved to the next step. When you delete a step that contains a transaction end, the end is moved to the previous step. If a transaction starts and ends in the same step, the transaction is deleted when the step is deleted.

Tip: When a transaction start or end is moved to another step because the start or end step is deleted, the start or end event is reset to the default.

Transactions for steps are not sequential. You can use the same transaction name in different sections of the script to join the times of actions that are not one after another. To use the same name in different places, use TC.startTransaction(name) and TC.endTransaction(name, status) for a synchronous function, or TCA.startTransaction(name) and TCA.endTransaction(name, status) for an asynchronous function.

You can add transactions for steps that are adjacent by using the transaction editor.

Back to top

Transaction editor

To access the Transaction Editor, click the button from the TruClient menu toolbar, or press Ctrl + Alt + F7.

User interface elements are described below:

UI Element
Description
Adds a new transaction.
Deletes the selected transaction.
General
Enables you to edit the name of the transaction.

Transaction names must be unique and may contain letters or numbers. Do not use the following characters:  . , : # / \ " < @ &.

Start/End Point

 

The step and the event that marks the start and the end of the transaction.
 
An event can be one of the following:
  • Step started. The first event triggered when a step starts running. The event triggered before the step action has started running and before any other activity takes place.
  • Action started. This event occurs immediately after the Step started event and signifies that the action to be performed has started. For example, the action might be navigation to a URL or a button click.

  • Action completed. This event is triggered when the action to be performed has completed. However, the step may not have ended yet. For example, for steps related to the application, there might be additional network or DOM activity.
  • Step synchronous network completed. Step ends when all HTTP requests have been completed excluding requests that are associated with open connections that are not relevant to the step. Usually, these requests are triggered by using XMLHttpRequest.
  • DOM Content Loaded. Step ends when the page's Document Object Model (DOM) is ready. This means that the API for interacting with the content, style and structure of a page is ready to receive requests from your application's client-side code.
  • Document Loaded. Step ends when the process of loading a document is completed. This means that all scripts and stylesheets have finished loading and have been executed, and all images have been downloaded and displayed.

  • Dialog opened. Step ends when a dialog box is opened.

  • Step completed. This event is triggered as soon as the work inside the step container has completed. It is triggered only if the step completed successfully.
  • After step ended. The last event in the events chain. It occurs after Step completed, but unlike Step completed, it is triggered regardless of whether the step was completed successfully or not.

Back to top

See also: