I am trying to create an executable out of a Coded UI Test which opens a browser and performs a set of operations. I would prefer a simple .exe file instead of using a batch file or using MS Test Agent, to be able to run it across computers without issues. Any other way of executing the Coded UI Test with a simple click, without the use of Visual Studio is welcome.
Thanks.
You cannot create a .exe file from CodedUi Project
but you can use another Project for that.
Step 1
Create your CodedUi Project
. Use the CodedUi Test Builder
to create your TestMethod(s)
that executes the actions you want.
Step 2
Create another Project that has a reference to your CodedUi Test Project
and calls your recorded Test Methods
. If you just need to run only one method then create a simple Console Application
. If you need something more complicated (e.g. choose the CodedUI Test Method
to run) a Windows Form Application
would be more appropriate.
I know that is late, anyway this can serve to others more.
You can delegate this work to MSTest, you can do a .bat or make a console application that executes the next:
set MSTestEXE=%PROGRAMFILES%\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe
"%MSTestEXE%" /testcontainer:CodedUITest\bin\Debug\CodedUITest.dll
CodedUITest.dll is the dll that generates Visual Studio.
MsTest will execute all tests showing you the results on the CMD and even will generate the TestResult.trx file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With