locked
How to continue Test Method execution if any Test Step Fail RRS feed

  • Question

  • Hi,

    Please help me to resolve below scenario in Coded UI Test - 

    I have one Test Method with multiple steps like - 

    [TestMethod]

    public void Sample()

    try{

    ControlA.Text = "Test1";

    ControlB.Text = "Test2";

    ControlC.Text = "Test3";

    ControlD.Text = "Test4";

    Mouse.Click(ControlGo)

    catch (Exception ex)
                    {
                        Console.WriteLine(ex);
                  }

    So, if Coded UI will not be able to enter or find or perform action on ControlB.Text then next steps will not execute.

    Complete Test Method will stop and failed and will go to Exception.

    I want to continue till end to my Test whether any in between step was not executed.

    Please suggest me approach to do this.

    Thanks


    Ankit

    Friday, June 19, 2015 4:25 AM

Answers

  • Hi Ankit,

    Based on your issue, I suggest could try to create a ordered test to add your coded UI test method into it, then enable this continue test after failure option to check this issue.

    Step Follow

    1Add one more Test name ordered test

    2Make the Ordered of the test you willing to execute

    3 Check the checkbox option continue test after failure

    The link below shows more details:

    # Coded UI Test: How to continue execution after test case fails
    http://www.codeproject.com/Articles/636640/Coded-UI-Test-How-to-continue-execution-after-test

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Tina-Shi Friday, June 26, 2015 10:31 AM
    Monday, June 22, 2015 5:13 AM
  • This question is often asked. I suggest doing a web search for terms such as "coded ui continue after failure". There are numerous blogs and questions on various web site giving suggestions.

    Regards

    Adrian

    • Marked as answer by Tina-Shi Friday, June 26, 2015 10:31 AM
    Monday, June 22, 2015 8:45 AM

All replies

  • Hi Ankit,

    Based on your issue, I suggest could try to create a ordered test to add your coded UI test method into it, then enable this continue test after failure option to check this issue.

    Step Follow

    1Add one more Test name ordered test

    2Make the Ordered of the test you willing to execute

    3 Check the checkbox option continue test after failure

    The link below shows more details:

    # Coded UI Test: How to continue execution after test case fails
    http://www.codeproject.com/Articles/636640/Coded-UI-Test-How-to-continue-execution-after-test

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Tina-Shi Friday, June 26, 2015 10:31 AM
    Monday, June 22, 2015 5:13 AM
  • This question is often asked. I suggest doing a web search for terms such as "coded ui continue after failure". There are numerous blogs and questions on various web site giving suggestions.

    Regards

    Adrian

    • Marked as answer by Tina-Shi Friday, June 26, 2015 10:31 AM
    Monday, June 22, 2015 8:45 AM