Transactions

Any sequence of interactions or page clicks can be grouped as a transaction. Transactions are mechanisms to measure server response time for any operation. In simple words, the use of the word “Transaction” helps to measure the time taken by the system for a particular request.

Need of Transaction

Transactions in Script are needed due to the following reasons:

Start End transaction

In the script, Transaction API can be used anywhere in the flow files. For using Start-End transaction user has to select one or more pages from the script editor. It will automatically add ns_start_transaction API before selected page(s) and ns_end_transaction API after the selected page(s).

Example:

voidflow()
{
// Using transaction for home page
ns_start_transaction("HomePage");
ns_web_url ("Homepage", "URL=http://127.0.0.1/tours/index.html");
ns_end_transaction ("HomePage", NS_AUTO_STATUS);
}
  1. Enter the Transaction Name.
  2. In Advanced, you have the following options: