Forum Discussion

petarT's avatar
petarT
New Contributor
8 days ago

ReadyAPI 3.56.0 does not fail testcase if iteration in datasource fails

Hi,

We have a datasource which takes data from excel to feed in the request. This excel has multiple rows, each row creates a different request and each row gets it's own assertion data. Since release 3.56.0, it seems like whenever an iteration fails from the datasource that is NOT the very last row in the datasource, the test case will still be reported as passed.

As a workaround, I'm trying to create a custom testcase property "hasFailed" with a standard value of "false". Whenever an assertion fails, the testcase property is set on "true", but whenever I try to execute the follow script in my test case teardown script:

def hasFailed = testRunner.testCase.getPropertyValue("hasFailed")
if (hasFailed == "true") {
    log.info(hasFailed)
    testRunner.fail("Testcase failed, check transaction log for more details")
}

it doesn't seem to work. The log.info is displayed but the testRunner.fail doesn't fail the test case itself. Any tips on how to fix this?

  • petarT's avatar
    petarT
    New Contributor

    I've created a work-around by using a test case property "hasFailed" with the value false, then via groovy change the property to true if the assert fails and failing the test case if the property is true in the teardown script.

    However I feel like this issue should be fixed on smartbear side