this is my very basic code (i'm trying automate some tests on an application and am using messagebox to display my progress thru the app) I get passed "here 3" but I get stuck further with an error below code1.Is there a way to highlight all the controls within eventTab2 (or any object that I nominate?like some sort of recursive get?) and also return the type of object it is with all it properties?2. Could you explain the solution above so I can manipulate it (remember newbie)THANKS!!!1234567891011121314151617181920212223242526272829var mainWindow1 = new WpfWindow();mainWindow1.SearchProperties[WpfWindow.PropertyNames.Name] = "IntraBet [1.4.0.103] EQ3WNSTDB11";mainWindow1.SearchProperties.Add(new PropertyExpression(UITestControl.PropertyNames.ClassName, "HwndWrapper", PropertyExpressionOperator.Contains));mainWindow1.WindowTitles.Add("IntraBet [1.4.0.103] EQ3WNSTDB11");mainWindow1.DrawHighlight(); var eventStack1 = new WpfCustom();var eventStack0 = new WpfCustom();var eventTab0 = new WpfTitleBar(mainWindow1);var eventTab1 = new WpfMenu(mainWindow1);var eventTab2 = new WpfTabList(mainWindow1);var eventTab3 = new WpfTreeItem(eventTab2);var eventTab4 = new WpfText(mainWindow1);MessageBox.Show("got here0"); eventTab1.SearchProperties[WpfMenu.PropertyNames.AutomationId] = "menubar";eventTab1.DrawHighlight();MessageBox.Show("got here2");eventTab3.SearchProperties[WpfControl.PropertyNames.ClassName] = "MenuItem";eventTab3.DrawHighlight();MessageBox.Show("got here4");eventTab2.SearchProperties[WpfTabList.PropertyNames.AutomationId] = "windows";eventTab2.DrawHighlight();MessageBox.Show("got here3"); eventTab0.SearchProperties[WpfCheckBox.PropertyNames.AutomationId] = "chkIncludeSetted";eventTab0.DrawHighlight();MessageBox.Show("got here1");ERRoRTest Name: CodedUITestMethod1Test FullName: MSUItest.CodedUITest1.CodedUITestMethod1Test Source: g:\CodedUITest1.cs : line 39Test Outcome: FailedTest Duration: 0:00:51.9135788Result Message: Test method MSUItest.CodedUITest1.CodedUITestMethod1 threw exception: 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: 'TreeItem'ClassName: 'MenuItem'Search may have failed at 'windows' TabList as it may have virtualized children. If the control being searched is descendant of 'windows' TabList then including it as the parent container may solve the problem. ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.Result StackTrace: at Microsoft.VisualStudio.TestTools.UITest.Playback.E ngine.IScreenElement.FindAllDescendants(String bstrQueryId, Object& pvarResKeys, Int32 cResKeys, Int32 nMaxDepth)at Microsoft.VisualStudio.TestTools.UITest.Playback.S creenElement.FindAllScreenElement(String queryId, Int32 depth, Boolean singleQueryId, Boolean throwException, Boolean resetSkipStep)at Microsoft.VisualStudio.TestTools.UITest.Playback.S creenElement.FindScreenElement(String queryId, Int32 depth, Boolean resetSkipStep)at Microsoft.VisualStudio.TestTools.UITesting.UITestC ontrol.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)--- End of inner exception stack trace ---at Microsoft.VisualStudio.TestTools.UITesting.Playbac k.MapControlNotFoundException(COMException ex, IPlaybackContext context)at Microsoft.VisualStudio.TestTools.UITesting.Playbac k.MapAndThrowComException(COMException innerException, IPlaybackContext context)at Microsoft.VisualStudio.TestTools.UITesting.Playbac k.MapAndThrowException(Exception exception, IPlaybackContext context)at Microsoft.VisualStudio.TestTools.UITesting.Playbac k.MapAndThrowException(Exception exception, String queryId)at Microsoft.VisualStudio.TestTools.UITesting.UITestC ontrol.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)at Microsoft.VisualStudio.TestTools.UITesting.SearchH elper.GetElement(Boolean useCache, ISearchArgument searchArg)at Microsoft.VisualStudio.TestTools.UITesting.SearchH elper.Search(ISearchArgument searchArg)at Microsoft.VisualStudio.TestTools.UITesting.UITestC ontrol.FindInternal()at Microsoft.VisualStudio.TestTools.UITesting.UITestC ontrol.FindControlIfNecessary()at Microsoft.VisualStudio.TestTools.UITesting.UITestC ontrol.DrawHighlightPrivate()at Microsoft.VisualStudio.TestTools.UITesting.UITestC ontrol.<DrawHighlight>b__36()at Microsoft.VisualStudio.TestTools.UITesting.CodedUI TestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)at Microsoft.VisualStudio.TestTools.UITesting.UITestC ontrol.DrawHighlight()at MSUItest.CodedUITest1.CodedUITestMethod1() in g:\CodedUITest1.cs:line 76
var mainWindow1 =
new
WpfWindow();
mainWindow1.SearchProperties[WpfWindow.PropertyNames.Name] =
"IntraBet [1.4.0.103] EQ3WNSTDB11"
;
mainWindow1.SearchProperties.Add(
PropertyExpression(UITestControl.PropertyNames.ClassName,
"HwndWrapper"
,
PropertyExpressionOperator.Contains));
mainWindow1.WindowTitles.Add(
);
mainWindow1.DrawHighlight();
var eventStack1 =
WpfCustom();
var eventStack0 =
var eventTab0 =
WpfTitleBar(mainWindow1);
var eventTab1 =
WpfMenu(mainWindow1);
var eventTab2 =
WpfTabList(mainWindow1);
var eventTab3 =
WpfTreeItem(eventTab2);
var eventTab4 =
WpfText(mainWindow1);
MessageBox.Show(
"got here0"
eventTab1.SearchProperties[WpfMenu.PropertyNames.AutomationId] =
"menubar"
eventTab1.DrawHighlight();
"got here2"
eventTab3.SearchProperties[WpfControl.PropertyNames.ClassName] =
"MenuItem"
eventTab3.DrawHighlight();
"got here4"
eventTab2.SearchProperties[WpfTabList.PropertyNames.AutomationId] =
"windows"
eventTab2.DrawHighlight();
"got here3"
eventTab0.SearchProperties[WpfCheckBox.PropertyNames.AutomationId] =
"chkIncludeSetted"
eventTab0.DrawHighlight();
"got here1"