Load Testing by Example - Configuring a Testcase for Unique User Logins - Web Performance
Menu

Load Testing by Example

Configuring a Testcase for Unique User Logins

Read and post comments

Overview

This tutorial demonstrates configuration of a typical testcase to use a unique identity (username/password) for each virtual user (a.k.a. VU or simulated user) in prepration for load testing.

As an example, a testcase will be created for an ASP.NET sample program - the ASP.NET Issue Tracker System included in the Microsoft ASP.NET Starter Kit. However, the procedure will be nearly identical for any web-based login system in which the user enters a username and password into forms on a web page.

Prerequesites: This guide assumes a basic understanding of the Load Tester product. The Load Tester videos are a good introduction to the main features. It is assumed you have recorded a testcase.

Please note that this tutorial is based on Load Tester 3.5. The procedure is similar in other versions, but the details may vary slightly.

Creating the Login testcase

For this example we will be using an extremely simple scenario. It has three steps:
  1. Go to application homepage
  2. Login
  3. Logout
While simple, this testcase serves two purposes. First, it is the simplest possible testcase to demonstrate the task at hand. Second, our experience has shown that the login process is frequently one of the poorest performing pages in many web applications. In some applications, this is acceptable but in others it is not.

After recording the testcase, it will look like the picture below. Note that the middle page (after a successful login) shows the issues relevant to the user. When other users login, this page will only show issues that are relevant to that issue. In our sample database, the only issues that will be relevant to our tests users are those issues the user created. Thus when user user000 enters the system, only issues created by user000 will be displayed. We will use this to visually verify proper operation of the testcase when we replay it.

picture of testcase


Configuring Unique Identities

In order for each VU to assume a different identity, it must provide a different username and password when the fields from the login page are submitted. Effectively, it must simulate filling out the login page:

login page

The easiest way to do this is using the User Identity wizard. It can also be done manually, which will be demonstrated later in this tutorial.

Running the User Identity Wizard


There are a number of ways to invoke the User Identity wizard. The first time you attempt to replay the testcase (using the play button button), you will presented with the Testcase Configuration wizard. Choose the Use Different Logins option:

testcase configuration wizard

Choosing this option and pressing the Next button will invoke the User Identity wizard. If you have already completed the Testcase Configuration wizard, you will need to open the User Identity wizard manually. This can be done via the pop-up menu in the Navigator for the testcase, the main Edit menu or a toolbar button, as shown below:

open user identity wizard from toolbar 

The first page of the User Identity wizard is shown below. For any authentication based on entering fields in a web page, you should choose Authentication via a Web Page form. Other authentication methods (NTLM, client certificates, etc) are not covered here.

user identity wizard - page 1

On the next page, choose a unique identity:

user identity wizard - page 2

Next, enter the username and password that were used to record the testcase. The wizard will use this to locate the pages in the testcase where the username and/or password are used. For best results, ensure that the username and password used during the recording are not used anywhere in the testcase that are part of an authentication process.

user identity wizard - page 3

If you have already created or imported a dataset, choose the I have already... option and skip the next section of the tutorial. To create a new dataset now, choose the create a dataset option on the next page:

user identity wizard - page 4

Creating a new dataset


A dataset will be created where you can enter usernames and passwords to be used when replaying the testcase. Double-click the user1 cell and enter a username. Then press the enter button to move to the next cell to enter a password. Repeat the above step to enter a few username/password pairs.

user identity wizard - page 5

After entering the username/password pairs, press Next and Finish.

Using an existing dataset


If a dataset already exists with the usernames and passwords, choose the dataset and fields from the lists, as shown below. Search for "dataset" in the Help system for instructions on creating datasets and importing values into a dataset from a text file (e.g. a CSV file).

user identity wizard - page 6

Press the Next and Finish buttons.

Testing the configuration


The testcase is now ready to be replayed. If you already pressed the replay button (play button), the replay will start as soon as the configuration wizards are complete. If you ran the wizards manually, push the replay button now.

After the replay completes, selecting the second page in the testcase will show a list of testcases relevant to the user that is logged in. In the picture below, you can see that these are all issues created by user000, confirming that the user identity for user000 was used to enter the system.

testcase replay

The testcase is now configured correctly for using unique user identities. During a load test, different identities will be used by each VU, simulating the real-world condition of multiple different users entering the system.

If you are interested in examining the details of what the wizard did, continue on to the next section. Otherwise, skip the next section.

Examing the configuration details


The Fields view will show the fields used in the replay. The picture below shows that the username user000 and password pass000 were used during the replay.

To see what the changes the wizard applied to the testcase we need to look at the fields from the base testcase, rather than a replay. Switch back to the recording by selecting it from the replay drop-down at the top of the editor.

select the recording

After selecting the testcase, the fields will be displayed as shown below:

fields view

The txtUsername and txtPassword fields have been configured to use values from the dataset as shown. These changes were made by the User Identity wizard.

Conclusion


Using the User Identity wizard, testcases for most web applications that use a login page can be easily configured to simulate multiple user identities during a load test. The user simply provides a list of usernames and passwords and the wizard does the rest!

Feedback & Comments

Comments about this report may be posted at the company blog post.

Metadata

Christopher L Merrill
©2007 Web Performance, Inc.; v1.1

Version History

v1.0 - 1st public release (11 September 2007)
v1.1 - email cleanup (23 Jan 09)

Resources

Copyright © 2024 Web Performance, Inc.

A Durham web design company

×

(1) 919-845-7601 9AM-5PM EST

Just complete this form and we will get back to you as soon as possible with a quote. Please note: Technical support questions should be posted to our online support system.

About You
How Many Concurrent Users