nishanj
12 years agoOccasional Contributor
[Reg]Inconsistent use of CDATA between functional & loadtest
Much of our useful data is embedded in CDATA fields in our Response messages.
For example: <response><![CDATA[<status>0</status>]]></response>
We frequently use “Contains” assertions to check for expected values:
For example: “<status>0</status>”
Which works because the assertion finds the quoted string.
However, when the same TestCase is run via a Load Test, the previously passing assertions fail because the string passed to the Assertion by SoapUI would appear to be:
<response><status>0</status></response>
Initially we adopted the following approach. We updated the Contains Assertion to “Use token as Regular Expression” and accepted either string variant.
(?s).*((<status>0</status>)|(<status>0</status>)).*
However, with increasingly complex regular expressions and an increasing number of assertions to maintain we cannot continue with this approach.
1. My assertion is that SoapUI should by default provide a consistent interface for assertion processing regardless of whether the test step is being used in the normal or the load environment.
2. Is there a configuration option to enforce such consistency?
3. If the above does not exist, what do you suggest as the best approach for new test assertions and for revisiting existing test projects? I am aware of the CDATA removal Event Handler option that is documented on the soapui.org website.
For example: <response><![CDATA[<status>0</status>]]></response>
We frequently use “Contains” assertions to check for expected values:
For example: “<status>0</status>”
Which works because the assertion finds the quoted string.
However, when the same TestCase is run via a Load Test, the previously passing assertions fail because the string passed to the Assertion by SoapUI would appear to be:
<response><status>0</status></response>
Initially we adopted the following approach. We updated the Contains Assertion to “Use token as Regular Expression” and accepted either string variant.
(?s).*((<status>0</status>)|(<status>0</status>)).*
However, with increasingly complex regular expressions and an increasing number of assertions to maintain we cannot continue with this approach.
1. My assertion is that SoapUI should by default provide a consistent interface for assertion processing regardless of whether the test step is being used in the normal or the load environment.
2. Is there a configuration option to enforce such consistency?
3. If the above does not exist, what do you suggest as the best approach for new test assertions and for revisiting existing test projects? I am aware of the CDATA removal Event Handler option that is documented on the soapui.org website.