Forum Discussion

artieleech's avatar
15 years ago

Property Expansion in 'Contains' Assertion does not work

Hi,

I'm trying to Assert that as SOAP Response contains a particular value, using Property Expansion.

The Property is called UserId and is defined in a Property step in the Test Case.

However, when I added a Contains Assertion including ${#TestCase#UserId}, it ALWAYS succeeds. Even when User Id isn't in the Response.
As a further example, if I deliberately make a typo, say ${#Testse#UserId}, this STILL succeeds, but should fail due to the typo.

Has anyone seen this before, or can see what I'm doing wrong?

I've also used both TestCase and a Property at TestSuite level - neither worked.

Thanks

artie

1 Reply

  • I think your problem may have something to do with the fact that you are using a calling a property within a properties test step as I can use this well when calling from a TestSuite or TestCase property list.

    Try using:

    ${MyPropertyStep#stepName} or in your case ${Properties#UserID}

    instead. Seems to work for me in the same circumstances as yourself. Found the answer at http://www.soapui.org/Scripting-Propert ... nsion.html, final bullet point.

    It seems that the assertion ALWAYS succeeds where it can't find the property you're looking for, its only when you're searching for a negative response that you can tell if your assertion is working well enough.

    Hope that helps!