Very often, especially for applications used by a work force, you’ll need to simulate a situation where a user will log in once, perform a number of actions and then log out.
There are two ways to do this in AgileLoad the 1st is purely by recording a different script for each stage, the 2nd is by using TransactionBegin and TransactionEnd commands in the script.
Creating scripts to individually handle:
has the benefit that that the login and logout processes can be managed by just two scripts for all scenarios while the transaction process (you will probably need to simulate many different transaction types) can be handled separately. This could save some time, however consider that session state must be handled correctly and that variables must be passed from script to script. The variables can be handled easily by using USER scope (default setting) however executing the transaction part of the script alone will require that during testing and development of the script that the login and logout function are called at the top and bottom of each script using the Call Script <ScriptName>; command. You will need to remember to remove these lines before using the script as part of a load test.
When setting up a Job in AgileLoad Center the scenario would look something like this:
The number of iterations for the login script would be set to 1, the number of iterations or execution duration would be set as desired for the transaction (in this case the action of buying a book is set to 5 iterations per scenario execution) and the number of iterations for logout would be set to 1. This process is then repeated for each scenario iteration until the test is complete.
Next Modular Scripts