Dependent test cases


  • Is it possible to have Test Methods whose execution can be controlled dependent on result from others.

    for e.g-

    There is a Test Method(LoginPage) for login page & another(BookTicket) for booking ticket after login is successful. 

     If LoginPage is failing the than BookTicket should skip gracefully.

    And other Test Methods which are dependent on LoginPage test method should execute smoothly.

    I am new to Visual Studio. So if need more explanation please let me know.

    Thanks in advance 

    6. března 2012 10:53


  • As far as I know there is no standard way of doing this but you can enable this using the right set of checks before starting the test and setting the right variable when a test completes [success/failure].

    You can extend your logic to leverage TestInitialize and TestCleanup features to handle it at a comon place. TestContext object supplied to these methods can give you the test methods name too.


    • Označen jako odpověď Amit_ 8. března 2012 4:23
    7. března 2012 17:33