Rerun fail test case - MsTest

AnnyD 1 Reputation point
2022-04-04T04:32:34.237+00:00

Hi Team

I need to rerun the fail test case automatically using mstest in my automation project (selenium /C#)

I have few solutions as below but i am not finding the exact one . If any one has already worked ,pls help me out on this.

sol1 :

using TrxExtractFAiledTests.Exe , i will list out the failed test case by passing the dll through this exe and execute it .

But here the issue is , the final report will contain only these rerun test case results as the latest report . But i need the report should contain all the test case results.

Sol2 :

I found the below link but the code is not available and this looks complex !
https://www.codeproject.com/Articles/883305/MSTest-Rerun-Failed-Tests-Through-MSTest-exe-Wrapp

Sol 3 :

https://social.msdn.microsoft.com/Forums/en-US/65f00a6e-b118-408a-92e3-abfd384673f5/rerun-failed-tests-again-on-mstest?forum=vsunittest

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,020 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
351 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AnnyD 1 Reputation point
    2022-04-28T11:12:45.93+00:00

    @Tianyu Sun-MSFT Thank you . But solution 1 ,the issue is the latest report will have just the fail test cases which rerun .
    How log4net will help here ? Can you pls elaborate little more


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.