Web Test Validation Rules: How to validate a especific HTML Element

Hi,
I'm trying to use validation rules to validate the response of a Web Test.
I'd like to validate that a especific object (an input type= text, id=TextBox2) has a especific value.
I could validate that exists a Tag with this value, but I couldn't validate that this Tag was the one I want.
I mean, If I have two inputs type=text and I want Texbox2 to have a value (foo), but this value is set to TextBox1 I'd like my test to fail.
In order to do that I'm using a ValidationRuleRequiredAtributteValue, I set tagname=input, AttributeName=value and the expected value.
If the expected result is returned in TextBox1 instead of TextBox2, the test pass and I'd like the test to fail.
Am I using the wrong validation type Is there any way to do that

Thanks in advance


Answer this question

Web Test Validation Rules: How to validate a especific HTML Element

  • Rafe Wu

    I'll enter a bug to bring the validation rule up to parity with ExtractAttributeValue... In the meantime, you'll have to do this sort of validation in using code (custom validation rule or coded web test).

    Josh



  • AndrewVos

    I could do it using an extraction rule (ExtractAttributeValue) and the through a Coded Web Test make an assert with the expected value.
    It would be nice if the validation rules support something like extraction rules to make the target more accurate.
    Any additional idea to do this

    Thanks

  • Web Test Validation Rules: How to validate a especific HTML Element