locked
How to proceed futher even after the assertion fails RRS feed

  • Question

  • My test stopped executing the remaining steps if an assertion fails.

    I wanted to proceed futher even after an assertion fails. I want to see what all assertions are passed/failed at the end of the test run.

    Can anyone throw some light on this???

    Tuesday, November 9, 2010 12:03 PM

Answers

  • Sumanth,

    ContinueOnError flag won't work for Assertion failures. It will work only for other uitest actions.


    Please mark the post as answered if this answers your question. ThejK
    Wednesday, November 10, 2010 8:30 AM

All replies

  • The only way is to add a try catch and do some logging in the catch.

    Tuesday, November 9, 2010 12:47 PM
  • If you have any code snippet, how you handled using try catch, can you post it to me?

    Can we write the failed assertion statement in Test Results and continue to execute the rest of the statements??

     

    Tuesday, November 9, 2010 3:54 PM
  • Its just standard catching of exceptions. Nothing fancy.

    try{

    Assert.Equals(blah1, blah2);

    }

    catch(AssertionFailed ex)

    {

    Console.WriteLine(ex.Message);

    }


    Please mark the post as answered if this answers your question. ThejK
    Wednesday, November 10, 2010 5:02 AM
  • You can have ContinueOnError flag to true in play back settings to proceed if the action fails.

     

    Regards,

    Sumanth

    Wednesday, November 10, 2010 6:19 AM
  • Sumanth,

    ContinueOnError flag won't work for Assertion failures. It will work only for other uitest actions.


    Please mark the post as answered if this answers your question. ThejK
    Wednesday, November 10, 2010 8:30 AM