Database Validation Rules


  • I see built-in database validation rules that can be used with webtests. My quick try to use them the way I use the other validation rules failed, I get an error "DatabaseFieldValidation Validation Object reference not set to an instance of an object. Column=TestColumn, ExpectedValue=Test, WaitTime=15, Retries=1, DatabaseServer=servername".

    I could not find any document which explains them, can anyone direct me to the documentation or any idea on why I get this error?

    Can these be used with Webtests that test webservices?

    Monday, January 15, 2007 2:40 PM


  • I am able to figure it out, the database validation rules are coming out of the database library our DB programmers created, sorry about the confusion.
    Wednesday, January 17, 2007 1:33 PM

All replies

  • You should be able to use the validation rule with the web test.

    Could you post your web test (xml format)?


    Monday, January 15, 2007 4:19 PM
  • Here it is -

    <?xml version="1.0" encoding="utf-8"?>

    <TestCase Name="WebTest1" Id="51e3d301-be9b-4b62-9f82-11f6be950467" Owner="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" WorkItemIds="" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="" RequestCallbackClass="path.RequestFilter, path.WebTesting" TestCaseCallbackClass="">


    <Comment CommentText="test for bugs" />

    <Request Method="POST" Version="1.1" Url=http://path/service.asmx ThinkTime="0" Timeout="0" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">


    <Header Name="SOAPAction" Value="&quot;http://schemas/path/Publish&quot;" />



    <ValidationRule Classname="path.Database.DatabaseFieldValidation, path.Automation.WebTesting, Version=, Culture=neutral, PublicKeyToken=49300bd32cc704f8" Level="High">


    <RuleParameter Name="Column" Value="ColumnName" />

    <RuleParameter Name="ExpectedValue" Value="Test" />

    <RuleParameter Name="WaitTime" Value="15" />

    <RuleParameter Name="Retries" Value="0" />

    <RuleParameter Name="DatabaseServer" Value="servername" />








    Monday, January 15, 2007 4:35 PM
  • Can anyone please advise on this? The exception that is being thrown is

    System.NullReferenceException: Object reference not set to an instance of an object.
       at CompanyName.QA.Utilities.Automation.WebTesting.Database.DatabaseValidation.Validate(Object sender, ValidationEventArgs e)
       at Microsoft.VisualStudio.TestTools.WebStress.WebTestInstrumentedTransaction.ProcessCompletedRequest(Boolean completedSynchronously)

    Tuesday, January 16, 2007 1:42 PM
  • The build-in validation rules for VSTS web test are rules for Form Field, Find Text, Maxium Request Time, Required Attribute Value, Required Tag, and Validate TagContent. Are you using a third-party custom validation rule? If you are, then you need to debug the source code.
    Tuesday, January 16, 2007 11:43 PM
  • No, I dont have any third party validation rules that I am using. I only validation rules I am using are the inbuilt Visual studio validation rules and a couple of the custom validation rules that I came up with, and the custom rules have nothing to do with database validation.

    This is an interesting situation!

    Wednesday, January 17, 2007 1:19 PM
  • I am able to figure it out, the database validation rules are coming out of the database library our DB programmers created, sorry about the confusion.
    Wednesday, January 17, 2007 1:33 PM
  • Have you been able to fix this problem?
    Wednesday, January 17, 2007 4:21 PM
  • Yes, the problem is fixed, but it has nothing to do with the VS inbuilt validation rules. The validation rules that came with VS are working well.

    Friday, January 19, 2007 12:56 PM