Forum Discussion

MistaWizard's avatar
MistaWizard
Occasional Contributor
9 years ago
Solved

compare response of a failed test step to the "contains" assertion and log differences

I've been searching for a way to compare the response of a failed test step to the "contains" assertion of that test step, and spit out just the differences into a log file called that teststepname/l...
  • MistaWizard's avatar
    MistaWizard
    9 years ago

    Cool, i've been working on this non stop and I've got this so far (thanks to everyone for the help)

     

    import com.eviware.soapui.model.testsuite.Assertable.AssertionStatus

    def TestCase = testRunner.getTestCase()
    def StepList = TestCase.getTestStepList()

    StepList.each
    {
    if(it.metaClass.hasProperty(it,'assertionStatus'))
    {
    if(it.assertionStatus == AssertionStatus.FAILED)
    {
    log.error "${it.name} " + "${it.assertionStatus}"
    }
    }
    }