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 dynamically launching the executable based on the path where it was just built to, including the configuration(x86, x64).
Is there any way to get the path to an executable in a referenced project so that I can launch the application dynamically from my test project?
Selenium IDE supports XML data sources. Coded UI Test supports any data source supported by.NET framework, which can come in the form of a. CSV file, XML file. It can also support any other data source like SQL Server table, Access table etc.
Microsoft decided to deprecate Coded UI because the open-source UI testing tools such as Selenium and Appium have gained momentum in recent years, have a strong community backing, and are now pretty much industry standards.
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
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:
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