locked
Unit Tests In Load Tests: How to fail Unit Test RRS feed

  • Question

  • Hi,

    I've had a look around and can't seem to find an answer. I am using unit tests in my load test but I can't seem to get the test iteration to fail. When ever an error is thrown its logged in a text file but I don't see anything in the table view it simply shows the test iteration as passed. 

    I have tried using Assert.Fail but that doesn't seem to do anything when in a load test. Is there an equivalent to Outcome property in coded web test? 

    Kind Regards

    Tuesday, April 30, 2019 10:38 AM

Answers

  • Hi Pir.Rab,

    Welcome to MSDN forum.

    According to your description, I could not reproduce this issue. In my side, I add two unit tests into load test, the one uses Assert.Fail to fail unit test, the other uses the internal error, then both of them shows in the table view.

    So could you share detailed information about using unit test with load test in your side? If possible, I will appreciate that you provide screenshots about it or a simple sample by onedrive or github.

    Any feedback will be expected.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by Pir.Rab Wednesday, May 1, 2019 9:47 AM
    Wednesday, May 1, 2019 9:32 AM

All replies

  • Hi Pir.Rab,

    Welcome to MSDN forum.

    According to your description, I could not reproduce this issue. In my side, I add two unit tests into load test, the one uses Assert.Fail to fail unit test, the other uses the internal error, then both of them shows in the table view.

    So could you share detailed information about using unit test with load test in your side? If possible, I will appreciate that you provide screenshots about it or a simple sample by onedrive or github.

    Any feedback will be expected.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by Pir.Rab Wednesday, May 1, 2019 9:47 AM
    Wednesday, May 1, 2019 9:32 AM
  • Very weird closed all instances of VS and restarted machine and now I am getting the errors thrown. Not sure what happended there. But thank you Dylan for your help.
    Wednesday, May 1, 2019 9:47 AM