Search code examples
visual-studio-2012load-testingweb-testingvalidationrules

Validation rules/Expected inner text in Load Test Project VS 2012


Is there an option like "contains" or "like" in sql for validating just a fragment of text. I need to validate just a part of the code that's static, the rest is dynamic.

image 1


Solution

  • You could use an extraction rule of type "Extract regular expression" instead of a validation rule, just ensure that the Required property is set to true. Whilst an extraction rule must name a context parameter for saving the text found, there is no need to use that context parameter elsewhere.

    Validation rules and extraction rules are very similar in what they do, it is just that extraction rules save the text that is found and, optionally via the Required property, fail or not-fail the test if the text is not-found or found respectively.