Probably like most of you out there who work with SharePoint, you will probably be asked about testing the performance of the solution. For quite a few projects I have worked on recently I have been asked to test the performance and have often wondered the best approach to take.The best article I found was by Bill Baer which talks about the various applications that can be used to stress test the solution.
http://blogs.technet.com/wbaer/archive/2007/08/02/stress-testing-microsoft-office-sharepoint-server-2007-windows-sharepoint-services-3-0.aspx
After some further investigation I decided that I wanted to use Visual Studio Team System 2008 to stress test my SharePoint solutions. The testing applications within Visual Studio are fantastic and you don't even need to be a developer to use this. To show how easy it is I will take you through the steps needed to test uploading a document into a SharePoint document library. To begin with you will need to have installed Visual Studio Team System 2008 and at least know what the user interface looks like.
Once Visual Studio loads select the menu link at the top called "Test", and then select the "New Test" option.
You will then need to select the "Web Test" option and give it a name.
You will then be asked for a project name and then press okay for it to create the project.
Once the project is created, Internet Explorer should load and a recorder toolbar will load as shown below:
The recording toolbar will record every key stroke and URL that you visit so you can play it back later. In this example I am going to access a team site, then the document library and then upload a file.
Notice that as we access the sites and pages they are all stored in the recording toolbar. When you have completed the process press the "STOP" button. This will take you back to the main Visual Studio project and load the screen with the recorded URL's.
Just as a note here, there seems to be a problem here as the recording does not seem to record the form post parameters such as the file location etc that you would expect to see if you were using something such as Fiddler. I have not yet seen a fix for this but to fix it the following needs to happen.
You need to right click on first URL and select the "Add Extraction Rule".
Select the "HIDDEN" fields rue and simply name the context parameter name "1". This will extract any hidden field values from the running page context.
Now we need to add various form post parameters, these can be added by select the option on the right click menu.
A standard parameter is then added as shown below.
The following parameters need to be added with the values shown below:
To add a value to the parameter you can use the properties window in Visual Studio. The example below is for the upload control within SharePoint.
Now we have our test built we can simply run this (ensure that the original document is removed before testing). Once the test is completed the main Visual Studio screen should look at shown below:
This is just a basic example of using Visual Studio 2008 Team System for testing. In another post I will share the project that I have created for testing. It can be used to test things such as:
- Page Access
- My Site Access and Creation
- Site Creation and Deletion
- Upload Single and Multiple Documents
- Searching
If you pop over to Codeplex and access the following project SharePoint 2007 Test Data Population Tool, you can download a Visual Studio 2005 Team System project that has some of the same functionality that I am using in my own test projects, there is also an Excel Services test project.