I'm using Visual Studio 2010 Ultimate - visual c# - codedUI.
I'm putting together some automated testing for a client (smoke testing, regression testing, etc.) however the application I'm trying to do the test automation for isn't being cooperative. I've automated all of the client's web apps with no issues, but with their desktop application, I can't seem to get any unique identifier between any of the controls.
Here's a sample codedUI recording where I go through a tree structure in the application - I highlight several different items in the list, expand a list, click on an item, browse the window that launches etc.
/// <summary>
/// SomeRecordedMethod
/// </summary>
public void SomeRecordedMethod()
{
#region Variable Declarations
WinTitleBar uINavigatorTitleBar = this.UISomeRandomCompanyWindow.UINavigatorWindow.UINavigatorTitleBar;
WinEdit uIObjectdescEdit = this.UISomeRandomCompanyWindow.UINavigatorWindow.UIDw_navigatorClient.UIObjectdescEdit;
WinClient uICalendar1Client = this.UISomeRandomCompanyWindow.UIMaintainCalendar1Window.UIItemWindow.uICalendar1Client;
#endregion
// Click 'Navigator' title bar
Mouse.Click(uINavigatorTitleBar, new Point(241, 9));
// Click 'objectdesc' text box
Mouse.Click(uIObjectdescEdit, new Point(19, 11));
// Click 'objectdesc' text box
Mouse.Click(uIObjectdescEdit, new Point(39, 10));
// Double-Click 'objectdesc' text box
Mouse.DoubleClick(uIObjectdescEdit, new Point(37, 11));
// Double-Click 'objectdesc' text box
Mouse.DoubleClick(uIObjectdescEdit, new Point(20, 11));
// Double-Click 'objectdesc' text box
Mouse.DoubleClick(uIObjectdescEdit, new Point(42, 5));
// Double-Click 'objectdesc' text box
Mouse.DoubleClick(uIObjectdescEdit, new Point(61, 11));
// Click 'Calendar [1]' client
Mouse.Click(uICalendar1Client, new Point(632, 141));
// Click 'Calendar [1]' client
Mouse.Click(uICalendar1Client, new Point(671, 200));
// Click 'Calendar [1]' client
Mouse.Click(uICalendar1Client, new Point(675, 301));
// Click 'Calendar [1]' client
Mouse.Click(uICalendar1Client, new Point(686, 396));
// Click 'Calendar [1]' client
Mouse.Click(uICalendar1Client, new Point(686, 544));
// Click 'Calendar [1]' client
Mouse.Click(uICalendar1Client, new Point(478, 547));
// Click 'Calendar [1]' client
Mouse.Click(uICalendar1Client, new Point(579, 552));
// Click 'Calendar [1]' client
Mouse.Click(uICalendar1Client, new Point(579, 552));
}
Notice the multiple instances of 'objectdesc' and 'Calendar [1]'. Every duplicate occurance is a different control, but the action recording isn't picking that up.
When I try to run the test I obviously get: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties.
I'm new to test automation in Visual Studio, so I'm not sure what options I have at this point. Any advice would be greatly appreciated.
Thank you