PrakashKannan
7 years agoContributor
Fail 'SOAP request test step' from event handler
I want to check one condition in each test step response and If response has <my condition> then I have to fail the test step.
I created a event handler in a project level
'TestRunListener.afterStep' event handler with following code
import com.eviware.soapui.support.XmlHolder
def holder = new XmlHolder( messageExchange.responseContentAsXml )
def response=holder.getDomNode(myXpath)
if(mycondition)
//fail test step
testRunner.fail("Fail")
else
//pass test step
Two Question:
1.This is not failing the test step
2.If I want to fail only the SOAP test request how can I specify in the target of the event handler ?