I have a SoapUI test that performs a WSDL call.
This WSDL call is considered a success if either
SOAPResponse
SOAPFault
with a specific faultstring
How can I write a SoapUI test that will be successfull in both cases (and obviously only those cases) ?
EDIT my test case already has 3 assertions defined :
I would like to have something like
SoapUI will not be able to do what you want out of the box. All assertions you specify have (equivalent of) boolean AND: they all have to pass, to pass the step.
I can see two options to solve your dilemma.
Possibly something like:
def status = messageExchange.responseHeaders["#status#"][0]
if(status.contains("500")) {
log.info "Fault"
def faultStr = context.expand( '${#Response#//*:faultstring}' )
assert faultStr.contains("something special")
} else {
log.info "Non Fault"
}
Your other two assertions, SOAP response and Schema compliance, should apply regardless of fault or not.