I have just started using UI Automation to try and auomate testing of our in house applications.
I have managed to identify the various items in a table:
AutomationElementCollectiontableItem = tableList.FindAll(TreeScope.Descendants,newPropertyCondition(AutomationElement.ControlTypeProperty,ControlType.Custom));
AutomationElement[] itemListArray =newAutomationElement[tableItem.Count];
tableItem.CopyTo(itemListArray,0);
intitemIndex = 0;
intaeIndex = 0;
foreach(AutomationElementaeinitemListArray)
{
if(ae.Current.Name.ToString().Contains("New Application Wizard"))
{
itemIndex = aeIndex;
}
aeIndex++;
}
AutomationElementitemToSelect = tableItem[itemIndex];
The last line returns the required entry in the table. I need to be able to select and double click on this item.