I'm trying to figure out which is the command line arguments used by Visual Studio when you run the MsTest tests, I guess it starts with:
MSTest.exe /testmetadata:%SolutionName%.vsmdi /testlist:
But I couldn't figure out how to fill the testlist parameter, because both the test list name and id get the following error:
The test list path 8c43105b-9dc1-4917-a39f-aa66a61bf5b6 cannot be found.
An error occurred while executing the /testlist switch.
See following link. Even though this post is about msbuild. It uses exec task for calling mstest. If you use /testlist you need to give metadata file. You can use /testcontainer and give dll for your test project. It will run all of your tests.
It depends on how do you run your tests from Visual Studio. See the following examples:
You are selecting some tests from the
Test View
window and run themYour are running all the tests from the
Test View
windowYou have filtered your tests by a category through
Test View
window and run this categoryYou have opened the
*.vsmdi
file and selected someTestLists
to runYou are running Load or Ordered tests
You can combine the above examples (arguments) to create the
MSTest
command that suits on your case. The only restriction you have is that you cannot use the/testmetada
and/testcontainer
arguments together.As for the
TestList
argument you just need to give as parameter the name of the list. If it is not found then your test list does not exist or it does not belong to the*.vsmdi
you have defined on the/testmetadata
argument.I am sure that you have already done it, but you can check the following link: MSTest.exe Command-Line Options