All about the Strategy, Design, Customisation, Deployment and Development of SharePoint and its related Technologies

  Administration   All Me!! Baby!!   Business   CKS   CQWP   Development   Duffer Moments   Email   Errors   Family   Fixes   General   Groove   How To   How To Code   InfoPath   IRM   Longhorn   Lotus Notes   Migration   Mobility   Office System 2007   Personal Projects   Records Management   Search Server   Security   SharePoint   Silverlight   SQL   Tech Ed 2008   Testing   Vista   VSTO   WSS   XSL

[14/04/2008] MOSS2007 – Visual Studio 2008 Testing (Search)
 
Categories: Development, Office System 2007, SharePoint, Testing
 

In a couple of the past posts we have looked at using Visual Studio 2008 Team Edition to test our SharePoint 2007 installation. In this post we will look at how to test the search capabilities of SharePoint 2007. There's no need for any background here so let's just get straight into it. As before we have our demo testing solution and we have a demo web test project. To this project I am now going to select to add a new web test.

Make sure that you select the "Web Test" template and set the name as shown below:

So as before the web browser should open and be ready for recording. The recording facility is fantastic but as you get better at using it you may find it is easier to manually create the tests you require. Anyway let's begin by accessing the search centre home page.

As before notice how the URL visited is listed in the recording pane. To show you how it works simply search for the term "SharePoint", this should then load the search results on the right and also add this to the recording pane.

Now we have our little web test simply press the "Stop" button and it should take you back to Visual Studio 2008. The web test should then be listed as shown below:

As with the last few posts we will remove the following elements, for our demonstration we do not need them:

Our web test should then show only the items that we wish to use.

The purpose of this test is to not only test that search terms can be found but also to load test this process. To make this a true test we want to automate the search terms that are used. In the real world users would not search for the exact same word every time. To make it a real test we will set the web test to use four different words for the test. For this we will go back to our "TestParamaters.xml" file and add the following:

We now need to connect our web test with a data source and select the correct values to use within the web test project.

 

 

 

 

 

 

Once our data source is connected it should be listed below:

Firstly we need to modify the "Query String" for the search term to be a data bound option. To do this select the item in the list and then modify the properties of the value field.

Once we have set the query string value to the new value from the XML data source, we need to do the same as previously shown in the past blog post, the server URL needs to be read from the XML Data Source as well. This should then mean our web test looks as shown below:

Now we have created our simple test we need to run the test.

The results should then come back as you would expect, however notice that the web test only selected the top value from the XML data source and not the rest.

To ensure it reads each search term and runs the test accordingly select the "Edit run settings" option.

The current settings should be set to only run a single test:

Modify the settings as shown below, by selecting the "One run per data source row" option.

Now when we save the web test and re-run it; it should run once for each value in the search terms.

This means that we can now add more search terms to the XML data source and the test will adopt this. Search can be one of the best quick wins that you can give to a business that is why testing the performance should be just as important as uploading documents or creating team sites. In the next post we will create a full performance test that will use all the tests we have cone so far and run them for batches of users over a period of time.

 
0 Comments
 

Comments

Name:

URL:

Email:

Comments: