Web test fails due to the RequiredAttribute value validation rule

Hi ,

In response of my web test request I get the following:-

<td class="Simple">
<input name="container:Submission:contact:LastName" type="text" id="container_Sub_contact_LName" tabindex="9" class="cls1" NAME="LastName" label="LastNameLbl" />
</td>

For this I have added a RequiredAttribute value validation rule as:-

Tag name- input
Attribute name-name
Expected value-container:Submission:contact:LastName
Match attribute name-type
Match attribute value-text
Ignorecase- False

The test fails due to the above validation.As I am using the VSTS web tests the first time, I may be missing something , but not sure what

Any suggestions are welcome.

Thanks,
Snigdha



Answer this question

Web test fails due to the RequiredAttribute value validation rule

  • Varun Gupta

    I tried the required attribute value for another control( another tag in same page) and it works fine .

    The problem is only for this particular tag. Even if i make a validation for id of this tag, it fails.

    Thanks,
    Snigdha


  • ddynda

    I think your best bet it to write a custom validtion rule for this particular scenario.  Here is an example of a custom validatio rule: http://blogs.msdn.com/joshch/archive/2005/11/02/488398.aspx

    Here is the help page for custom validation rules: http://msdn2.microsoft.com/en-us/library/ms182556(en-US,VS.80).aspx



  • PaulOfTheGlen

    What is the error displayed on the details tab in the playback UI

  • Harry Strand

    Can you try and validate a value other than the name attribute, just to see if it works for you. For example try and validte the label attribute instead. I am wondering if 2 name attributes is messing you up. Please let me know if this works for you. If it does not, I would like to see the entire html response. If it is not to big, just post here. Otherwise, go to http://blogs.msdn.com/slumley/ and email me the page. Thanks.

  • drmcl

    I suspect the problem is that there are two "name" attributes on the input tag. I bet it's comparing the expected value against the other name attribute.

    To test if that's the case you could change your expected value to the value of the other name attribute and see if the validation rule starts passing. That would at least identify the problem -- then we can think about an alternate solution.

    By the way, I verified that the "Ignorecase" attribute applies only to the comparison of the expected value and not the comparison of the attribute name.

    Let me know what you find.

    Thanks,

    Rick


  • Lifeboy

    The error detail I see is :

    Required Attribute Value Validation No HTML tag named 'input' contained an attribute named 'name' with the expected value 'container:Submission:contactInfo:LastName'. TagName=input, AttributeName=name, MatchAttributeName=type, MatchAttributeValue=text, ExpectedValue=container:Submission:contactInfo:LastName, IgnoreCase=False

    I also tried validating for the other name attribute( as suggested by Rich) but it fails too.

    Thanks,
    Snigdha


  • Web test fails due to the RequiredAttribute value validation rule