Forum Discussion

MR102889's avatar
Regular Visitor
3 years ago

How to create an Contains Assertion which validates a specific portion of an XML (Use of wildcards)

Hi there,


I have been trying to create a Contains Assertion, and need to validate a specific portion of an XML. For example, say I want to validate:



The only thing I want to validate is the word "validate". Is there any way to use wildcards to only validate a specific portion of the resulting XML?


I was able to figure out how to use wildcards when using XPath Match Assertion (inputting an '*', and then enabling Allow Wildcards), but haven't been able to figure it out for Contains Assertions (tried using an '*', '%', and '.*<input text here>.*'), but nothing worked.


Any help would be appreciated.




1 Reply

  • richie's avatar
    Community Hero
    Hey MR102889,

    Im on my phone so cant double check, but if memory serves, the 'Contains' assertion uses regex.

    So you just need to use regex to verify the content is correct.