views:

532

answers:

1

My team has switched from J-meter to SoapUI for testing purposes.We are testing regular WSDL-based services. We used this nifty feature in J-meter where you could write assertions in the form of regular expressions to check the XML responses. For example if I wanted to make sure there were so many xml tags contained in the response you could use syntax like:

<[^>]*Code>(AA|BB|CC)</[^>]*Code>{3}

Which makes sure there are three code open/close tags and there are only certain values between the tags.

I tried similar syntax in the CONTAINS assertion component in SoapUI. It seems to support regular expressions but apparently not this particular syntax. Can anyone think of a workaround or different form of syntax? (Note: I dont know how to use Xpath,Xquery, or groovy, but if you can find a workable solution with it,ill accept it :-) )

+2  A: 

Hi!

You could try the following xpath assertion:

count( //Code[matches(text(),"AA|BB|CC")] )

with the expected content of

3

Does that work instead?

/ole eviware.com

Ole Lensmar
Actually it does work I was using it wrong with the tag hierarchy I have...THANKS ALOT!!! its all yours...
Egg