stop execution in a passed step

3 posts, 1 answers
  1. Doga Ercan
    Doga Ercan avatar
    21 posts
    Member since:
    Jul 2011

    Posted 21 Sep 2011 Link to this post

    Hi,

    I have a scenario as the following:

    There are 5 sequential pages including forms and one can go next page by clicking "continue" if all inputs are correct.
    If some inputs are not correct, there emerges error messages for the wrong ones and those error messages are validated.
    At this case I don't want to run remaining steps for next pages since they gonna fail because current page with erroneous cannot be passed.
    Is there a way to stop execution for this iteration and starts with new iteration from step1?

    "StopTestListOnFailure" option cannot be used here because it stops in a failed step but in my case it is not a failed step.

    I tried to use global variable and set it when erroneous input is seen and validated, but when I customize next steps in code and check this global variable, in test results I cannot see details of sub-steps so global variable would not be a good option for me.

    I hope I can explain my case well enough.

    Best regards

    Ercan
  2. Doga Ercan
    Doga Ercan avatar
    21 posts
    Member since:
    Jul 2011

    Posted 21 Sep 2011 Link to this post

    Hi again,

    Maybe it is better to ask it in short.
    Is it possible to stop execution without setting any result fail?
    Afterwards I want to go on with next iteration (data row)

    Thanks

    Ercan
  3. Answer
    Cody
    Admin
    Cody avatar
    3354 posts

    Posted 21 Sep 2011 Link to this post

    Hi Doga Ercan,

    I am going to suggest you may be making a common mistake that many QA engineer's make when they first start writing test automation... that of trying to put too much into a single test. From a high level there should be one test per use/test case. For example:

    Test Cases
    1) Can enter good data in all fields and successfully save the record
    2) Bad data entered into field A yields error message A
    3) Bad data entered into field B yields error message B

    The above should be 3 separate tests. You might be able to modularize and reuse parts using our test-as-step feature, but if properly designed, you won't run into the problem you are asking about (how to make a test skip steps 15-20 and start over again with the next data iteration).

    To answer your question, there isn't a direct way of making a test stop in the middle without a failure. The closest you can come is to use an IF-ELSE logical block, which can be nested if needed. Run some steps in the IF and others in the ELSE. This way the test runs to the end, but only runs the steps needed for that particular instance.

    Best wishes,
    Cody
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top