Ask a Question

Using Reg Expressions in Xpath assertion

cdunne
Contributor

Using Reg Expressions in Xpath assertion

Hi,

Is it possible to supply a regular expression as the value to validate against in the xpath assertion rather than a wildcard character?

Cheers

Cormac
1 REPLY 1
omatzura
Super Contributor

Hi Cormac,

you can use the regex support in xpath 2.0 for this; if you want the text of a certain element to match a certain regex, specify the following:

matches( //somelement/text(), '.*' )

and set the expected value to true or false (whichever you want)

The matches function available in soapUI is documented at

http://www.saxonica.com/documentation/f ... tches.html

Hope this helps!

regards,

/Ole
eviware.com
cancel
Showing results for 
Search instead for 
Did you mean: