Web Testing SharePoint 2010 with Visual Studio 2012 Update 1 CTP 3


UPDATE: 10/29/2012 – Updated link text for Update 1 from CTP 3 to Update 1 CTP 4 Final

I am certain this has been a long standing request from Visual Studio by the community, myself included.  If you’ve attempted this in the past with previous versions of Visual Studio you would have realized quickly that it wasn’t quite up to the task unless you heavily edited the recording that was produced.  It’s not that the Web Test would have failed but the fact that requests to pages named:

  • blank.htm
  • ScriptResx.ashx
  • commandui.ashx

would have remained as part of the recording.

Visual Studio 2010 Web Test Recording

Previous versions of Visual Studio also would not recognize a Site Name as a Parameter either.

To get started you’ll need to ensure you have the following installed:

Visual Studio 2012 Ultimate (Web Performance Testing is an Ultimate Feature)

Visual Studio 2012 Update 1 CTP 4 Final (available here)

To verify you’ve got everything and you’re ready open Visual Studio 2012 and select Tools | Options | Web Performance Test Tools | Web Test | SharePoint and you should see the following:

I’ve already had to add an additional Pattern to the out of the box settings because one of the SharePoint sites I was recording was returning a blank.html page.

To get started create a New Project | Installed | Templates | Visual C# | Test | Web Performance and Load Test Project

If you don’t see the Template make sure the .NET Framework is set to either 4.0 or 4.5 so the template displays.

New Web Performance and Load Test Project

Once the project has been created Add a Web Performance Test to it and your web test will be added and Internet Explorer will be launched ready to record your actions.

While it is recording don’t be alarmed by all of the requests listed in the Web Test Recorder window, the requests for ScriptResx.ashx, blank.htm and others will be removed once the recording is stopped.

Recording SharePoint Web Test

Let’s stop the recording and allow Visual Studio to process the web test recording

SharePoint Server 2010 Web Performance Test
One of the things you’ll notice right away is that the site names have already been extracted for you:

  • SiteName1=sp2010pillars
  • SiteName2=Projects
  • SiteName3=M300DigitalCamera

If you wanted drive the site names from a SiteNames.csv file you could easily add a data source to the web test and then perform a search and replace on {{SiteName1}} and replace it with {{Datasource1.SiteNames#csv.SiteName}}

I think you’ll find this extremely valuable for testing your SharePoint Server configurations, you can also easily configure an Extraction Rule on your individual requests to get values of SharePoint Calendar Dates and Items, List Items, Documents and others.

SharePoint - Add Extraction Rule

Let me know how you make out!

About wesmacdonald

Wes MacDonald is a Visual Studio ALM MVP, MCT, MCTS, MCITP (SharePoint) and a Principal Consultant for LIKE 10 INC., a SharePoint Server, Visual Studio and Team Foundation Server Consulting Firm providing premium support and guidance services.

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,067 other followers

%d bloggers like this: