Can we use Coded UI Automation to some automate UI workflow (using Console application) other than testing? RRS feed

  • Question

  • Hi

    I need to automate some UI screens and user actions to accomplish something. I tried to build a console application using Coded UI assembly references and implemented a sample automation. But it is throwing me an error as below.

    "An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Microsoft.VisualStudio.TestTools.UITesting.dll

    Additional information: Could not load file or assembly 'Microsoft.VisualStudio.TestTools.UITest.WindowsStoreUtility, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified."

    But the same piece of automation is working fine if I run the Test Method from visual studio test explorer. Could someone please throw me some pointers on how to tackle this? I tried searching for this in internet but got no luck. Nobody seems to have come up with this requirement so far.

    Any help is appreciated.



    Thursday, April 14, 2016 4:48 PM


  • Hi Kiran,

    I'm afraid that we can't use Console application using Coded UI assembly references to implement a Coded UI Test.

    Since I create a sample Console application based on your description, and compare this project with the default Coded UI Test project, I found that the project type is not the same. Coded UI Test project is a Class Library, but Console Application is not a Class Library.

    Even though I have add all Coded UI assemblies and add a Coded UI Test method in my Console application, when I select it through right-click -> Run selected test, it is failed. When I change the Output type to Class Library, the test method can be run successful.

    Best Regards,

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.

    • Edited by Weiwei Cai Monday, April 18, 2016 7:31 AM
    • Proposed as answer by Weiwei Cai Tuesday, April 19, 2016 10:13 AM
    • Marked as answer by Weiwei Cai Monday, April 25, 2016 10:25 AM
    Monday, April 18, 2016 7:30 AM