Coded UI Test - How to Change the EXE It Runs

I created a coded user interface test from a Microsoft Test Manager entry. The exe that it launches are the ones the tester has written to.

I want this to be the test that I ran with my build. How to change the exe that is used for the encoded user interface test is the output:

  • TFS assembly at start of TFS assembly
  • Local build when the test runs on my machine.

I DO NOT need help adding my Coded UI test to my TFS build. There are some great posts on that already .

I haven't ApplicationUnderTest.Launch. I have this.UIMap.StartApplication();one that then runs the generated code (in CodedUI.Designer.cs). "Best Practices for Coded User Interface Tests" "Do not edit the UIMap.designer.cs file directly. If you do, changes to the file will be overwritten."

+3
source share
2 answers

You can add the assembly configuration to the test project. In this configuration, add the PRIVATE_BUILD preprocessor definition.

Then you can use #IFDEF to determine which assembly to run:

#ifdef PRIVATE_BUILD
ApplicationUnderTest.Launch(pathToPrivateBuild, "", args);
#else
ApplicationUnderTest.Launch(pathToOfficialBuild, "", args);
#endif // PRIVATE_BUILD

, TFS .

+2

Source: https://habr.com/ru/post/1743520/


All Articles