Design - General

Table of contents

Creating Business Transactions
Logging in With Multiple Accounts Using a CSV File
Creating Realistic Populations
Validating a Server Response
Executing Java Code

Creating Business Transactions

Understanding the Context

The main objectives when load testing your application are to obtain an accurate evaluation of performance and to precisely identifying performance bottlenecks. To achieve these objectives, creating scenarios that define realistic populations and realistically-behaving virtual users is essential. In addition, one technique that will greatly help you to in refining your benchmarks is to use what are known in NeoLoad as Business Transactions (or put more technically, Containers).

A business transaction is a set of related pages that achieve a consistent business interaction. A typical example is the set of pages a user goes through to login to an application. The idea is to assemble those pages into a container so that NeoLoad can produce precise time consumptions and statistics on those pages as a whole. These containers will appear separately in test results making analysis easier. In our login example, you would obtain statistics on the response times users experience from the moment they start connecting to the application to the moment they're actually logged in.

The first step in using business transactions is to identify recurring behavior, especially behavior that represents an important functionality in your application. Once this behavior pattern has been identified, the corresponding pages must be assembled in a container, a Virtual User Container in NeoLoad parlance. This tutorial details the steps involved in building these containers.

Virtual users are one of the main building blocks NeoLoad provides to create load test scenarios. Virtual users assemble recorded HTML pages, populations group virtual users and, finally, a load test scenario assembles populations. This tutorial will briefly describe the steps involved in building a virtual user that has a container. It will also show the types of results obtained using this technique. For more details on creating populations and running scenarios, see the reference guide.

Example Overview

We'll base our example on the JPetStore application, an on-line pet store web application.

The application provides typical merchant web site functionalities : creating an account, signing in, browsing through pets, adding pets to a shopping cart, and finally checking out and purchasing what's been added to the cart. We identify the purchasing phase as critical because it is resource greedy and time consuming. We need and want detailed statistics on this phase.

We ignore the interactions concerning the actual choice of pets and their quantity, we are only interested in the pages in which the client confirms and checks out what he or she has purchased. The following screen shots depict those pages:

  1. Whatever the client has ordered, the following page submits a form containing payment and billing address information (/jpetstore/shop/newOrderForm.shtml):

  2. The second step is a page prompting the client for confirmation of previously entered billing address information (/jpetstore/shop/newOrder.shtml):

  3. The final step is a page summing up payment, address and order details (/jpetstore/shop/newOrder.shtml_1):

Building the Business Transaction when Recording

During the recording, the Recording Bar allows you to define business transactions (or containers).

Procedure 16.1. Creating a business transaction during the recording

  1. Start the recording.

  2. To begin a new business transaction, enter its name in the "Container" text field.

  3. Carry out the actions relating to the business transaction in the browser.

  4. To finish the business transaction, delete or replace the name in the "Container" text field.

  5. To stop the recording, close the browser or click on the "Stop" button in the NeoLoad Recording Toolbar.

[Note]Note

Only those business transactions at the virtual user root may be created using the Recording Toolbar.

Building the Business Transaction after Recording

This section details the steps involved in creating a container (business transaction) relating to the above pages.

  1. Select Design mode

    Click on the button.

  2. Select the "Virtual Users" tab

  3. Add a virtual user container

    1. Adding a container to a virtual user

      In the "Virtual Users" pane, select the last page in the virtual user (/jpetstore/shop/newOrder.shtml_1) then right-click on the page. In the pop-up menu, select "Insert after", then "Container".

      Next, select the new container and rename it "Checkout".

    2. Select the pages to add to the container

      Select the pages to add to the container, then drag and drop the pages in the container.

      [Tip]Tip

      You can select multiple pages by using a left click while holding the CONTROL or SHIFT keys down.

    In our example we have added the container as the last element of the virtual user. We have added to the contents of the container the three HTML pages included in the order interaction:

    1. /jpetstore/shop/newOrderForm.shtml : contains the payment details and the billing address information,

    2. /jpetstore/shop/newOrder.shtml: sums up order information and prompts the user for the confirmation,

    3. /jpetstore/shop/newOrder.shtml_1: presents the order confirmation.

    We know that the interaction involved by these three pages includes possibly time consuming processing such as account verification and order submission. This is where having fine grained results on a particular container will become useful.

Building a Population and a Scenario

In our example we have created a population called Buyers containing the PetStore user. The population as a whole represents a realistic projection of how the Pet Store application will be used. The following screen shot shows how the population is configured using the PetStore virtual user in Design mode:

In Runtime mode, a scenario called Scenario1 has been created and configured so that it only contains the Buyers population:

Analyzing Business Transaction Results

This section describes where to analyze business transactions. The whole point of creating business transactions is that NeoLoad explicitly identifies them and provides distinct results for each one.

Results Summary

After having launched the scenario in "Runtime" mode, the first place you will see results specific to the container is in the "Results Summary" tab, which can be viewed in "Results" mode. A section called "Containers" summarizes the statistics for all the containers used in the scenario. The summary provides an overall view of a particular business transaction's (container's) behavior:

Results Values

The "Values" tab in "Results" mode gives more details on the business transaction. Select a particular virtual user and choose the "Logical Actions" item in the "Filter" list. You can then select the container representing the business transaction, in our case the Checkout container, as seen in the following screen shot. You may now work with the various statistical elements to deepen your understanding of the business transaction's behavior.

Results Graph

The "Graph" tab in "Results" mode also provides details on the business transaction. You can select a particular virtual user and then select the container representing the business transaction, in our case the Checkout container, as seen in the following screen shot.

Related Links

For more information on how to create realistic populations see the section called “Creating Realistic Populations”.

For more information on how to analyze results, see the Reference Guide