Tips for load test by using Visual Studio 2012 Ultimate

Tips for load test by using Visual Studio 2012 Ultimate

 

Have some time to use the visual studio 2012 ultimate edition for load test recently.  So there is some basic tips about this.

1.      Only the ultimate edition VS 2012 has the web performance and load test ability.
Trial version VS 2012 only support Max 25 user load.
You must install all the VS update for the load test. As first version VS 2012 has many bugs in testing. Current latest UP is 3.

2.      You can follow the walk through of the Microsoft to step by step create the web test and load test.  This is fast and best way to start learn recording and concepts.

http://msdn.microsoft.com/en-us/library/vstudio/ms182551.aspx

http://msdn.microsoft.com/en-us/library/vstudio/ms182552.aspx

http://msdn.microsoft.com/en-us/library/vstudio/ms182594.aspx

And I have some tips can make you understand advanced load test skills quickly:

 

How to deploy test used resources files for the file test?

Such as you want test upload file feature , so you need source file to use,  when the web test is recorded, web test will not use the source folder of yours anymore. So you have to put the source file into the deploy folder of your test project. What you need to do is to add the folder or files into your project, by add files from “local.testsettings”—deploy, you can realize this.

http://msdn.microsoft.com/en-us/library/vstudio/ms182475.aspx

 

How to make the web site host URL as the parameter input for web test?

There is feature called “Parameterize Web Servers” feature in the web test, can auto extract the site host name and port number from the requests. This can save the time if you want switch your test from a UAT server to a production server.   What you to do is just modify the “WebServer1” and other  parameters to change the host name.

How switch test from a http site to a https site?

If your target has enable the https, but all site content are same. What you need to do is change the “Parameterize Web Servers” data to make it as https, you do not need to re-record all your request.

What you need to do from a web test to a load test?

1.      Your web test may run fine if you just run once every time, but start to run it as the load test may get issues as concurrent user will cause the conflicts if user conflict at the features, such as check in and check out same file, rename/delete same file etc.

2.      A load test recorded by default will create random unique resource names, such as you upload a file, load test will create unique file name for you at the upload request. Open your request and check the  file name , under the properties, there is some thing called “Generate Unique Name” to control whether or not create unique name for each request.

3.      After you have the web test, and you prepare the data source csv file already, then add/create DS into your test project, you can use the DS data in your load test to let test use the file name from the DS. By this format{{}}, what you need to do is to go through each request data to check if any thing can be changed/inserted by the DS data, by this way you can create a mean full load test. Such as each user load create separate file/ rename/delete/check in /check out separate file. File named is dynamic defined from DS csv file: this will avoid load test failed by conflicts.

4.      In load test, there is some thing important, one is the “load pattern”, you need to understand “constant load ” and “step load” pattern, it will be very useful. And under the “Running Setting” , the “Run Duration” and “Test Iteration” is very important.  Iteration here mean run once the web test, when a load test start to run, each user load will run the iteration again and again, unless  the Max Test iteration reached or time duration is reached. This is basic idea of the load test works.

 

Data drive test by data source – how to create a csv file and use it as data source for your test request?

You can create a Data source into your test project by a CSV file:

username, password
user1, password1
user2, password2
user3, password3
user4, password4
user5, password5

then you can use the data by binding call, {{ UserDS.UserNameFile#csv.username}} in the request data input. Check each request data and web server XML input to make sure the data is changed upon your needs.

http://msdn.microsoft.com/en-us/library/ms404707.aspx

http://msdn.microsoft.com/en-us/library/bb385971.aspx

Data source access methods explaination

http://blogs.msdn.com/b/slumley/archive/2008/03/14/description-of-access-methods-in-data-sources.aspx

How to create different user account from a data source (csv file) to log in to the page?

You can create a csv file with user name and password inside, and use it in the web test as the Data source, to load test will auto log in with these users during the test, please note this does not means the “user load” in the test. Even you only has one user account , user load still can simulate hundreds concurrent user load for you in test.

http://social.msdn.microsoft.com/Forums/en-US/80c15dfd-5265-4e9f-becc-5e13fdf19596/how-do-i-configure-multiple-users-in-a-load-test

How to create a plugin to do each user use each row from DS?

http://social.msdn.microsoft.com/Forums/fr-FR/5853028c-d297-45fb-ba46-ae346fa1e21c/load-test-datasource-distribution

how to create a plug in

http://msdn.microsoft.com/en-us/library/ms243191%28v=vs.100%29.aspx

Difference between the concurrent users load and VS multiple account?

http://social.msdn.microsoft.com/Forums/en-US/5829e774-f552-42e9-b43d-46daaaa4e6a0/load-testing-for-concurrent-users

how to debug a web test

http://blogs.msdn.com/b/slumley/archive/2007/04/10/how-to-debug-a-web-test.aspx

 

How to install test controller and agent

If one test client is not enough, you can install the controller and agent to make several client PC to make the test.

http://msdn.microsoft.com/en-us/library/vstudio/hh546459.aspx

http://msdn.microsoft.com/library/hh546460%28v=vs.110%29.aspx

 

 

Advertisements