Forum Discussion
hi ,
Adding some scripts to get the test status results in the log ,
hope it help.
// get the testStep
/*def testStep = testRunner.testCase.getTestStepByName('householdGet')
// print assertion names an its status
testStep.getAssertionList().each
{
log.info "$it.label - $it.status"
}*/
//---------------------------------------
def soapStep = testRunner.testCase.testSteps["householdGet"]
for( assertion in soapStep.assertionList )
{
log.info "Assertion [" + assertion.label + "] has status [" + assertion.status + "]"
for( e in assertion.errors )
log.info "-> Error [" + e.message + "]"
}
//---------------------------
def responseStatus
def listOfAssertions = testRunner.getTestCase().getTestStepByName("householdGet").getAssertionList()
for (assertion in listOfAssertions)
{
// You can get the status of any assertions and here I am getting the value for NotSoapFaultAssertion
if (assertion instanceof com.eviware.soapui.impl.wsdl.teststeps.assertions.soap.NotSoapFaultAssertion)
responseStatus= assertion.getStatus()
responseStatus = responseStatus.toString()
}
log.info "responseStatus is : $responseStatus"
if (responseStatus == "VALID")
{
log.info "Proceed To Validation"
}
else {
log.info "Skip Validation"
}