Executing coded UI test from a standalone application

后端 未结 7 1812
庸人自扰
庸人自扰 2020-12-01 22:33

I found several blog posts about how to execute code UI tests using mstest utility, but I need to execute them from my C# application. I tried the simplest thing: I created

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 23:21

    I am executing the coded UI test with a bat file, you can simply copy the CUIT test .dll file to your application and call it by a bat file to execute. Even you can use Test Agents to run the Code UI Test from different machines, where you don't have Visual Studio.

    my bat file looks like this:

    Run All Test methods from DLL :

    
    "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\mstest.exe" /testcontainer:"DLL_Location\CUIT_03.dll" /resultsfile:"ResultFile_Location\result.trx"
    

    Run Single Test Method From DLL:

    
    "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\mstest.exe" /testcontainer:"DLL_Location\CUIT_03.dll" /test:"TestMethodName" /resultsfile:"ResultFile_Location\result.trx"
    

提交回复
热议问题