Specifying user names for load test

Hi,

We have a web app that uses forms authentication. Each user can only be logged in once. If you try to log in with the same user name again, you get kicked off. What is the best way to handle load testing in such a scenario?

I don't really want to write a separate test for each user. Data-driven testing doesn't work here, as it calls the test sequentially for each row in the database. Is there some way to specify at the load test level that I want to simulate 200 users and that I want user1 to be X, user2 to be Y, etc.

The only thing I found at that level is the number of users you want to simulate and how you want to generate the load (constant, step, ...). There was no way to specify user names outside of the actual test level, which doesn't solve my problem.

Thanks.

[799 byte] By [Gerhardo] at [2007-12-17]
# 1

Hi,

1. Create a contextparameter with the same name for each webtest.
2. Link the contextparameter to your logonname field.
3. Create a class with a static method that returns the user you want, for example by iterating through the rows of a static datatable.
4. Create a webtest plug in and fill the context parameter in the PreWebTest event. The code wil be something like: e.WebTest.Context[ "LogonName" ] = UserProvider.NextUser();
5. Attach the plugin to your webtests.

Because the datatable is static it's shared between all requests. You may have to place a lock in the static method to prevent conflicts.

Hope this helps,

Regards,

Martijn

martijnv at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 2
Thanks.
Gerhardo at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...

Visual Studio Team System

Site Classified