0

I'm trying to run a coded UI test on our application. I can record the actions OK, but when attempting to playback, I get

Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: 
        The playback failed to find the control with the given search properties. 
Additional Details:
TechnologyName:  'UIA'
FrameworkId:  'Wpf'
ControlType:  'MenuItem'
AutomationId:  'MenuItemConnectId'

When I run Snoop on the application, I see the AutomationId exists

enter image description here

The one odd thing about our application is a lot of the ID's are added with code behind

        menuItem.SetValue(AutomationProperties.AutomationIdProperty, "MenuItemConnnectId");
        menuItem.SetValue(AutomationProperties.NameProperty, "MenuItemConnect");

Any ideas why this may be failing? Thanks.

doobop
  • 4,465
  • 2
  • 28
  • 39

2 Answers2

1

I think there are two reasons: 1.Maybe the component can't find the property.You can see the details in the xxx.Designer.cs file. In the method SearchProperies[]..... 2.The road to search the component is broken.You can see the details in the UI control map.Maybe the the component's parent is wrong.In this situation,you can add the code to connect them.

Keith Liu
  • 11
  • 2
0

Turns out I needed the title of the window to be set. Even though I had the Automated ID and name properties set, looks like the engine uses the window's title in order to find it on the desktop. A few more details are here: MSDN question on Coded UI test fails to find Window (Component)

doobop
  • 4,465
  • 2
  • 28
  • 39