Forum Discussion

d4vke's avatar
d4vke
Occasional Contributor
7 years ago

Execute next testcase when the previous one failed

I have the following setup: A testsuite with 2 testcases TCA and TCB. Each testcase contains 3 teststeps (TSA1, TSA2, TSA3 & TSB1, TSB2, TSB3). In TSA2 I have added an assertion that makes th...
  • HimanshuTayal's avatar
    HimanshuTayal
    7 years ago

    d4vke,

     

    In that case, as far as my knowledge says, no inbuilt feature is there in ReadyAPI where you can do this.

     

    For this you need to write bit groovy in each step to achieve this. or you can create a run controller which execute all your TestCases via groovy only(but this needs too much coding)

     

    Write Script Assertion, which check whether the Step is passed or not, 

    if step status == passed(validating this by userName or by response Header or if using SOAP then by status)

    {

    'do nothing

    }

    else

    {

    'disable next steps

    context.testCase.getTestStepByName("RetrieveData").setDisabled(true)

    context.testCase.getTestStepByName("DeleteData").setDisabled(true)

    }

     

    And write below code in TearDown of your TestCase to again Enable those TestCases.

     

    context.testCase.getTestStepByName("DeleteData").setDisabled(false)

     

    Click "Accept as Solution" if my answer has helped, and remember to give "kudos" :)

     

    Thanks and Regards,

    Himanshu Tayal