Transactions Section

The transactions that are referenced in the workload (dcluser) section, are defined in the transactions (dcltrans) section. Transactions define the actions of virtual users by submitting function calls in order to interact with the application under test, for example calling Web functions to access a Web application published by a Web server. Describing transactions is done using a Pascal-like syntax.

The transactions that are executed by the virtual users, which are specified in the workload section, are defined using the keyword dcltrans.

Syntax

TransSection = Transaction { Transaction }.

Transaction  = "transaction" ident1 [ "(" TParList ")" ]
               [ "const" ConstDecl ]
               [ "var" VarDecl ]
               [ "result" "set" IdentList ";"]
               "begin" StatSeq "end" [ ident1 ] ";".

The name of a transaction (ident1) is defined after the keyword transaction. In TParList the input parameters of the transaction are specified. Random variables and constants are valid input parameters of a transaction.

ConstDecl contains the declarations of the transaction constants. These constants can be used only inside the transaction where they are defined (transaction scope).

In VarDecl the variables of the transaction are declared. These variables can be used only inside the transaction where they are declared. Variables of the simple types number, float, string and boolean are allowed. You can also declare arrays or lists of simple types (ARRAY [numberOfArrayElements] OF simpleType, LIST OF simpleType).

StatSeq contains the statements of the transaction.

Example

transaction TMain
  begin
    WebPageUrl("http://myHost/ShopIt/");
    ...
    // more functions that describe the tasks of this TMain transaction
    ...
    WebPageLink("Products");
  end TMain;

For database load testing only

IdentList defines the scrollable database cursors of the transaction. Cursors that are not scrollable must not be defined after the keywords result set; they are defined implicitly. Result-set cursors and scroll forward cursors cannot share the same names.