In Focus

Add Validation Rule in Visual Studio 2008 Team system test Edition

In this Article we are going to describe how to add validation rules to a Web test.


We need to add validation rules to ensure that the Application is working as expected. Validation rules are also helpful to verify the request time to finish.

We have found several validation rule options in Add validation Rule Pop up:

  • Form Field- Verifies the expected form field with Actual specified name and value.
  • Find Text- Verifies the expected text with Actual specified text in the response.
  • Maximum Request Time- Verifies the request finishes within a specified of time.
  • Required Attribute Value- Verifies the existence of a specified HTML tag that contains an attribute with a specified value.
  • Required Tag- Verifies the existence of specified HTML tag in the response.
  • Response UR- Validates that the response URL after redirects are followed is the same as the recorded response URL. 

Adding a validation rule to a Web test
  1. Right-click on the Web request in the Web Test Editor
  2. From the context menu select "Add Validation Rule". 
Image 1.JPG

This will open the Add Validation Rule window:

image 2.JPG

We have multiple Validation rule options to choose from.
  1. Select the Find Text rule. 
  2. Enter Welcome User in the Find Text property. 
  3. Set the Ignore Case property to True.
  4. Click on OK button.
image 3.JPG

Now our web test, under the request, a new folder called Validation Rules with the rule we just created in it.

Image4.JPG

Click the run test from the top for web test again

image5.JPG

erver'>