Run your Load Tests against multiple server environments, like localhost, development or integration

Load Tests help us identify bottlenecks in our application and can answer with high precision how many users our infrastructure can support in a given time. In a previous article I gave you some tips for using the Load Tests from Visual Studio in a more efficient way.

Today I would like to show you how you can run the same load tests against different server environments, for example on your localhost machine and on the integration server, before deploying a change into the production.

We first create a new Web Performance Test, we add a new request to it and then a new context parameter which is going to be the common part of the url that we can use inside our Web Test:

Create a Web Performance Test

Then we create a new Load Test that uses the Web Test we just created. By default a Run Settings1 is added to the test:

Create a lod test

We now rename the default Run Setting into a more meaningful name. This Run Setting is going to be used when we test against our local machine:

Rename the default Run Settings

We add a new Run Setting for testing with the software version of our integration server:

Add a new Run Settings

and we override the context parameter that was defined in the Web Test, with the url of the integration server (Important here is that the name of the context parameter is the same as in the Web Test):

Override the context parameter for the new Run Setting

Finally, you have to activate the new Run Setting (right click on the Run Setting title).

You can now imagine, how you could create a new Run Setting for other servers and test them with your load tests.

comments powered by Disqus