How to run codedUI test on visual studio build pipeline



  • I have a simple test case developed by CodedUI:

    1. Open run by windows + r
    2. Add "iexplorer"
    3. Hit enter Navigate to my webpage
    4. Do an assertion.

    I can run this on my local PC, but is there any way to set up this as a build pipeline at visualstudio.com?

    Actually I did that, but I'm getting an error at the "Test Assemblies" stage:

    Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: Unable to find the top level element of the control ---> Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: Unable to find Windows Internet
         Explorer window with 'C&W DASH - Internet Explorer' in the title. ---> Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details:
        2018-11-09T17:41:41.6496491Z TechnologyName: 'MSAA'
        2018-11-09T17:41:41.6496660Z ControlType: 'Window'
        2018-11-09T17:41:41.6496907Z Name: 'C&W DASH - Internet Explorer'
        2018-11-09T17:41:41.6497064Z ClassName: 'IEFrame'   
        2018-11-09T17:41:41.6497222Z ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
    


  • I think you should use the Coded UI launch methods instead of starting the application with Windows. I think the visualstudio.com might not launch the test in an interaction desktop.

    Code example, from here:

    BrowserWindow oBrowser = BrowserWindow.Launch(new Uri(url));
    

    Never the less MS is dropping Coded UI support and advices to switch to WebDriver:

    Coded UI Test for automated UI-driven functional testing is deprecated. Visual Studio 2019 is the last version where Coded UI Test will be available. We recommend using Selenium for testing web apps and Appium with WinAppDriver for testing desktop and UWP apps. Consider Xamarin.UITest for testing iOS and Android apps using the NUnit test framework.

    https://docs.microsoft.com/en-us/visualstudio/test/use-ui-automation-to-test-your-code?view=vs-2019


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2