Can I run MS tests from an external file?

69 views Asked by At

I am trying to re-run the failed tests as a fresh run in the same batch. Using Test outcome I want to find the failed tests and add them to an external file (XML/any format). When my batch completes the tests, I want the same batch to run failed tests (from XML/Any format) ? Can I do that ??

1

There are 1 answers

0
Arun M On

Here's one strategy assuming you want to use command line:

  • Parse the trx file to find the failed tests and obtain testId
  • Create a vsmdi file with the testId of failed tests
  • Run the test list as mstest.exe /testMetadata:<path/to/vsmdi>. See here for documentation.

A detailed post about internals of trx and vsmdi: http://blogs.msdn.com/b/dhopton/archive/2008/06/12/helpful-internals-of-trx-and-vsmdi-files.aspx

OR, There's a wrapper over mstest.exe which reruns tests.