3
votes

We are trying to migrate our coded UI tests from MTM to TFS2015 vNext web based test management.

Before in MTM, after a test run is done, you can right click and rerun failed test cases. But in the test run that launched by "run functional test" task in vNext build, there is no such option (you can not even see the test run in MTM).

I would like still be able to select the failed test case and rerun it in the same test environment, and update the test result in the same test run after the rerun finish.

Any way to achieve this?

Thanks, Angel

2
The 'rerun' feature is based on the previous test result, do you mean you want to 'rerun' tests in a new build? BTW, the test result won't be updated if 'rerun' test via MTM, just create a new test result in a new test run. Why do you need to update test result?starian chen-MSFT
After build completes, we have CodeUI tests run on Test PCs/VMs. And testers would like to be able to rerun failed test cases on the same Test PC for triage and investigation purpose. In MTM, under a completed test run, you can right click on Failed test cases and "Reset tests to Active", and the tests will be rerun on the same Test environment, and also the test run result will be updated based on the rerun result. We would like to have the same functionality when we migrate to VNEXT build.Angel
Being able to update test result based on the rerun result is for reporting purpose (e.g. test pass rate for each day's daily build)Angel
I don't think you can update the existing automated test result.starian chen-MSFT

2 Answers

0
votes

There is no default way/task to rerun failed tests in TFS vnext build. But I've found there is a custom application supports to rerun Failed Tests.

Then you can add a Command Line task to invoke MSTest.Console.Extended.exe in order to be able to rerun failed tests as mentioned in the article below:

https://www.codeproject.com/Articles/883305/MSTest-Rerun-Failed-Tests-Through-MSTest-exe-Wrapp

enter image description here

0
votes

I was able to collect failed test cases from all the test runs that related to a build/release through TFS Rest API, then I could pass in the failed test case name to test case filter in the "Run Functional Test" tasks to rerun those tests in remote Test PCs in the specified Machine Group. I did not find a way to launch test runs against specified machine group through Rest API.