Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make soapUI test case fail when HTTP error code is returned

Tags:

soapui

I'm using soapUI 4.5.1 and want to set up a test case like so (using REST requests that are already in the project):

  • Authenticate to the server, receive cookie
  • Request another resource that is only available when authenticated

The problem I have is that the requests still show up as [FINISHED] even if the server returned HTTP 400, for example. In the test case options, I've found the setting "Fail on error" which is enabled. Any way to fail when the HTTP return code is not 200-ish ?

like image 301
AndiDog Avatar asked Dec 14 '25 20:12

AndiDog


1 Answers

Add a "Valid HTTP Status Codes" Assertion to the request, it takes a list of HTTP Response codes that are considered valid and asserts otherwise.

There is also a "Invalid HTTP Status Codes" Assertion which asserts if the response is in the list.

SOAPUI Getting Started with Assertions

like image 56
Martin Spamer Avatar answered Dec 16 '25 23:12

Martin Spamer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!