VS 2010 Coded UI Test - Launch Referenced Application

后端 未结 3 1250
粉色の甜心
粉色の甜心 2020-12-24 07:52

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

3条回答
  •  感情败类
    2020-12-24 08:01

    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 --

    1. From inside MS Visual Studio IDE, in Solution Explorer, click on your CodedUI project to highlight it, right click, select "Add", select "Existing item"
    2. In Add Existing Item dialog, navigate to the executable that you want to test within your CodedUI project. Click on the file to highlight it, then locate "Add" drop-down list on the dialog window and select "Add as Link", click OK
    3. Go back to Solution Explorer, click on CodedUI project again and expand it. Now you should see an icon .exe listed inside CodedUI project
    4. Right-click on .exe icon and select "Properties"
    5. In Properties window, set BuildAction to Content and Copy to Output Directory Copy Always

    Voila!!!

提交回复
热议问题