Forum Discussion

qatester05's avatar
qatester05
Occasional Contributor
14 years ago

[Resolved] Skip Current test case and move to next Test case

Hi,
I would like to skip execution of some test cases in my test suite. For this, i have a Groovy Script at the beginning of each test case to check for a condition and if the condition is true i have to skip the current test case and goto Next Test case. Do we have any option to do this using groovy script simillar to gotoTestStepbyName()?

Say gotoNextTextCase()?

Thanks,
Srikar.
  • RJanecek's avatar
    RJanecek
    Regular Contributor
    you can disable this test: context.getTestSuite().getTestCaseByName(nameOfTestCase).setDisabled(true) and then this test isnt perform and in teardown script you can all test enabled again setDisabled(false)
  • Hi Srikar,

    Unfortunately there is no such API call currently but it sounds like an interesting idea so please add a features request in the corresponding forum board so we can get this into the flow of things..

    thanks!

    /Ole
    SmartBear Software
  • qatester05's avatar
    qatester05
    Occasional Contributor
    @RJanecek..thanks for the reply. This approach worked for me.