Forum Discussion

Florian_Hofmann's avatar
Florian_Hofmann
Contributor
10 years ago
Solved

Run TC10 tests with MSTest.exe command line

Hi everyone,

 

What I accomplished so far

I read http://support.smartbear.com/viewarticle/56562/ and implemented what I found there in Visual Studio 2013:

I hve my "Automated_QA" project, where I rightclicked and selected "Add|Test Complete 10 Test", there I imported the TestComplete project (the .mds file), selecting TestExecute as preferred test runner.

 

The "Test Explorer" view now lets me organize the tests, including selecting and deselecting items as defined in TestComplete, there I can run exactly the items I want, reproducing the test runs and result I got when running the tests from TestComplete locally, or TestExecute on a VM

-> everything great...so far.

But I don't want to run the tests from VS2013, but from command line, using MStest.exe...

 

What I failed at:

 

When I build my project/solution, a file "Automated_QA.dll" will be created. I can use the file as an argument for MSTest.exe, but it keeps telling me that there are no tests to be found.

If I use the "/test:" command line parameter with the name of the TC10 test as shown in the solution explorer (which also creates a corresponing file in the directory with the .dll), the test can not be found.

 

However if I don't add a TestComplete Test in the Solution Explorer, but a conventional unit test, this unit test IS available and started by MSTest.exe.

So I assume it's not a Visual Studio issue (which might be more appropriate in a VS forum), but a matter of getting a TC10 test recognized as test by MStest.exe...so I'm hoping for anyone around here who has already done this, and would be willing to share their solution.

 

Thanks in advance,

Florian

 

  • Hi Florian,

     

    I suspect that the Automated_QA.dll library isn’t generated in the needed format or it doesn’t contain the definition of tests. This is why you are unable to get the list of them. Using unit tests can be a solution in this case.

2 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Florian,

     

    I suspect that the Automated_QA.dll library isn’t generated in the needed format or it doesn’t contain the definition of tests. This is why you are unable to get the list of them. Using unit tests can be a solution in this case.

    • Florian_Hofmann's avatar
      Florian_Hofmann
      Contributor

      Hi Tanya,
      thanks for your answer.
      First of all, I guess I got it wrong how Visual Studio and MSTest are supposed to perform TestComplete tests - and failed to re-think my approach in time, which could have spared me and you my post in the first place...
      In Visual Studio's solution explorer's tree structure, both TC10 tests and unit tests are equally inserted below the project node...in both cases you accomplish that by right-clicking the project node and select "add|[..] test"...in both cases, the respective test will appear in the Test Explorer view, and both kinds of test can be run seperately or together by some "run all tests" function.

      That's why I expected both kinds of test to be euqally included into the compiled project - and that's where I was wrong: Looks like the TC10 tests are compiled into files of their own (.tc10Test files), which can be called by MSTest.exe the same way a .dll file would be called to run a unit test (using the /testcontainer:[filename] switch).
      I guess I might use unit tests to run TC10 tests as you suggested, but since TC tests are the only kind of test I want to run, I guess I'm equally happy with calling .tc10Test files where I tried to run .dll files...

      So thanks again - and sorry after all...I really could (and should) have noticed that the output directory does not only contain the [Projectname].dll I expected, but also some file bearing the name of my TC10 tests...

      Florian