Preventing a step from failing a test

2 posts, 1 answers
  1. Steve
    Steve avatar
    1 posts
    Member since:
    Mar 2013

    Posted 06 Jun 2013 Link to this post

    I have a data driven test. The second step is a login. The handle login is successful on the first iteration, however, subsequent iterations it fails since we are re-using the browser instance. I set the "continue on failure" option, but the subsequent iterations are marked as failed just because of the login step is not needed. How do I get around this?
  2. Answer
    Cody avatar
    3354 posts

    Posted 06 Jun 2013 Link to this post

    Hi Steve,

    This problem is pretty easily overcome by properly architecting your tests. Place the core of your test into a sub-test. Leave just steps one and two in your current main test. Data bind the subtest, not the parent test.

    You can actually do this very quickly and easily by selecting the core of your test (steps 3 to the end), right clicking and selecting "Create Test as Step". Test Studio will prompt you for the name of the new sub-test and do all the grunt work for you. Once done all you need to do is modify the data binding... remove it from the parent test and add it to the new subtest.

    I hope this helps.

    Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
    Reserve your seat today!
Back to Top