I\'m using Visuial Studio\'s Coded UI Tests to run Automated UI tests on a WPF Application everytime a build runs on my TFS server. The problem I am running into is dynamica
I've been struggling for some time with trying to figure out how to tell my CodedUI project where to launch the executable from and how to do it "right", so it works automatically when different users run the code in different workspaces, on different hosts etc. I did come up with copying the executable into a shared directory (step in the right direction) and then recording an action to start it from there (band aid, so it at least works for different users on the same host).
Here are the steps from your MSTest instructions, adapted for MS Visual Studio 2015 Enterprise IDE. Sadly, I do not have enough "reputation points" to be able to embed screen shots --
Voila!!!
As Zian Choy wrote, using the steps provided by Adam, the application under test is not being copied to the .../Out directory. The following additional steps worked for me:
MSTest:
In your [TestInitialize]
add the following to launch your app:
_yourApp = ApplicationUnderTest.Launch(Path.Combine(Directory.GetCurrentDirectory(), "yourexecutablename.exe"));
In your [TestCleanup]
you add the following:
_yourApp.Close();
NUnit: (you will need to reference and use Microsoft.VisualStudio.TestTools.UITesting)
In your [Setup]
add the following to launch your app:
_yourApp = ApplicationUnderTest.Launch("yourexecutablename.exe"));
In your [Teardown]
you add the following:
_yourApp.Close();
note: I have not verified the NUnit implementation