0
votes

We have a somewhat large project with a series of tests against endpoints. Due to the way the configuration for this API works, there's occasionally a chance that a field in any given response could be missing, replaced with the string "[invalid field]". Obviously when this happens, something is broken and we need to fix it, so I want to check for this string in all responses.

Is there a way to check all responses for this, or should I just put an assertion into each test manually?

3
Which edition of SoapUI are you using? i.e., open source or pro or ng? - Rao
Different people on the team have different versions, and ideally they'd all be able to run the tests. If it matters in terms of creating the solution, I have access to any version. - a p
I am not talking of version of soapui, rather asking free or paid software. - Rao
I'm not understanding you. I use ng usually, we have licenses for pro available if I need one for these features. Future users of the test suite might not have that access though, so I'd rather not rely on a pro only feature if possible. - a p
Ok, that is what I was looking for. - Rao

3 Answers

2
votes
  1. Create one assertion via SOAPUI.
  2. Go to the project's XML file and find </con:request>. Right after it there is a <con:assertion>...</con:assertion> element.
  3. Find and replace all </con:request> with <con:assertion>...</con:assertion>
  4. Assertion magic all over the place.
1
votes

I would handle this by putting the assertion in the first test step. Get it working the way you want. Then click the copy icon in the assertion toolbar. It will bring up a dialog that allows you to copy that assertion to 1 or more test steps. Select all the test steps you want it copied to.

1
votes

You can use Event Handler feature, afterStep and have check/assertion so that it can apply for all of your requests.

For more details check the link