Forum Discussion

danielko's avatar
danielko
New Contributor
12 years ago

Test step for skipping others?

Hi,

how can I define a test step that if it is reached will end/terminate the test immediately?

Example Steps:

-Conditional goto (if true, jump to property transfer2, else continue)
-property transfer1
-terminate the testcase
-property transfer2
-...

Now, if the condition matches, prop transfer 2 and following steps should be executed.
If not, then only prop tranfer1 should execute and after that the TC should just end, omitting any other steps...

Thanks

3 Replies

  • Aaronliu's avatar
    Aaronliu
    Frequent Contributor
    The focus on terminate test case. if false, only property transfer1 execution, and then execute terminate test case, you can try to add script in this step like this:
    testRunner.cancel("Test Case Terminate")

    or
    testRunner.getProperty("#TestSuiteRunner#").cancel("Test Suite Terminate")
  • nihao15's avatar
    nihao15
    New Contributor
    danielko wrote:
    Hi,

    how can I define a test step that if it is reached will end/terminate the test immediately?

    Example Steps:

    -Conditional goto (if true, jump to property transfer2, else continue)
    -property transfer1
    -terminate the testcase
    -property transfer2
    -...

    Now, if the condition matches, prop transfer 2 and following steps should be executed.
    If not, then only prop tranfer1 should execute and after that the TC should just end, omitting any other steps...

    Thanks

    let me trythis!