Ask a Question

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

MR102889
Regular Visitor

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:

<data>ThisiswhatIneedtovalidate</data>.

 

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.

 

Thanks,

MR102889

1 REPLY 1
richie
Community Hero

Re: How to create an Contains Assertion which validates a specific portion of an XML (Use of wildcar

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.

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
cancel
Showing results for 
Search instead for 
Did you mean: