I have a WPF application with GridView which has a button for each row:
<telerik:RadGridView x:Name="radGridView" Margin="8" ItemsSource="{Binding Quotes, Mode=TwoWay}" ShowGroupPanel="False" AutoGenerateColumns="False" Height="250">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn>
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<Button Content="Download Quote"></Button>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding QuoteId}"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding ProductModelId}"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding TechnicalPrice}"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding ModelPrice}"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
After using record and playback of actions to click the button, when replaying back the test, I get an error in regards to "Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details: "
Is GridView supported even?
According to this page, it should have been by now http://www.telerik.com/help/wpf/coded-ui-support.html
Is RadGridView able to support Coded UI Testing and any suggestions on how to fix it?
Full error:
Test Name: CodedUITestMethod1
Test FullName: CodedUITestConcepts.CodedUITest3.CodedUITestMethod1
Test Source: c:\TFS\DOTNETConcepts\Code\CodedUITestConcepts\CodedUITestConcepts\CodedUITest3.cs : line 27
Test Outcome: Failed
Test Duration: 0:01:44.527071Result Message:
Test method CodedUITestConcepts.CodedUITest3.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'
ControlType: 'Cell'
ColumnHeader: ' '
AutomationId: 'Cell_0_0'
Search may have failed at 'Test List' Tree as it may have virtualized children. If the control being searched is descendant of 'Test List' Tree 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.Engine.IScreenElement.FindAllDescendants(String bstrQueryId, Object& pvarResKeys, Int32 cResKeys, Int32 nMaxDepth)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindAllScreenElement(String queryId, Int32 depth, Boolean singleQueryId, Boolean throwException, Boolean resetSkipStep)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindScreenElement(String queryId, Int32 depth, Boolean resetSkipStep)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapControlNotFoundException(COMException ex, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowComException(COMException innerException, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, String queryId)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetUITestControlRecursive(Boolean useCache, Boolean alwaysSearch, ISearchArgument searchArg, IList`1 windowTitles, Int32& timeLeft)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetElement(Boolean useCache, ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.Search(ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindInternal()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<Find>b__d()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.Find()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetPropertyPrivate(String propertyName)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<>c__DisplayClass11.<GetProperty>b__10()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetProperty(String propertyName)
at Microsoft.VisualStudio.TestTools.UITesting.ALUtility.GetTechElementFromUITestControl(UITestControl uiTestControl)
at Microsoft.VisualStudio.TestTools.UITesting.ActionExecutorManager.GetActionExecutor(UITestControl uiControl)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.ClickImplementation(UITestControl control, MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinate)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.<>c__DisplayClass6.<Click>b__5()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.Click(UITestControl control, MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinate)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.Click(UITestControl control, Point relativeCoordinate)
at CodedUITestConcepts.UIMap.DownloadQuote() in c:\TFS\DOTNETConcepts\Code\CodedUITestConcepts\CodedUITestConcepts\UIMap.Designer.cs:line 91
at CodedUITestConcepts.CodedUITest3.CodedUITestMethod1() in c:\TFS\DOTNETConcepts\Code\CodedUITestConcepts\CodedUITestConcepts\CodedUITest3.cs:line 30
<telerik:RadGridView x:Name="radGridView" Margin="8" ItemsSource="{Binding Quotes, Mode=TwoWay}" ShowGroupPanel="False" AutoGenerateColumns="False" Height="250">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn>
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<Button Content="Download Quote"></Button>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding QuoteId}"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding ProductModelId}"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding TechnicalPrice}"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding ModelPrice}"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
After using record and playback of actions to click the button, when replaying back the test, I get an error in regards to "Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details: "
Is GridView supported even?
According to this page, it should have been by now http://www.telerik.com/help/wpf/coded-ui-support.html
Is RadGridView able to support Coded UI Testing and any suggestions on how to fix it?
Full error:
Test Name: CodedUITestMethod1
Test FullName: CodedUITestConcepts.CodedUITest3.CodedUITestMethod1
Test Source: c:\TFS\DOTNETConcepts\Code\CodedUITestConcepts\CodedUITestConcepts\CodedUITest3.cs : line 27
Test Outcome: Failed
Test Duration: 0:01:44.527071Result Message:
Test method CodedUITestConcepts.CodedUITest3.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'
ControlType: 'Cell'
ColumnHeader: ' '
AutomationId: 'Cell_0_0'
Search may have failed at 'Test List' Tree as it may have virtualized children. If the control being searched is descendant of 'Test List' Tree 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.Engine.IScreenElement.FindAllDescendants(String bstrQueryId, Object& pvarResKeys, Int32 cResKeys, Int32 nMaxDepth)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindAllScreenElement(String queryId, Int32 depth, Boolean singleQueryId, Boolean throwException, Boolean resetSkipStep)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindScreenElement(String queryId, Int32 depth, Boolean resetSkipStep)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapControlNotFoundException(COMException ex, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowComException(COMException innerException, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, String queryId)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetUITestControlRecursive(Boolean useCache, Boolean alwaysSearch, ISearchArgument searchArg, IList`1 windowTitles, Int32& timeLeft)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetElement(Boolean useCache, ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.Search(ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindInternal()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<Find>b__d()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.Find()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetPropertyPrivate(String propertyName)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<>c__DisplayClass11.<GetProperty>b__10()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetProperty(String propertyName)
at Microsoft.VisualStudio.TestTools.UITesting.ALUtility.GetTechElementFromUITestControl(UITestControl uiTestControl)
at Microsoft.VisualStudio.TestTools.UITesting.ActionExecutorManager.GetActionExecutor(UITestControl uiControl)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.ClickImplementation(UITestControl control, MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinate)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.<>c__DisplayClass6.<Click>b__5()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.Click(UITestControl control, MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinate)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.Click(UITestControl control, Point relativeCoordinate)
at CodedUITestConcepts.UIMap.DownloadQuote() in c:\TFS\DOTNETConcepts\Code\CodedUITestConcepts\CodedUITestConcepts\UIMap.Designer.cs:line 91
at CodedUITestConcepts.CodedUITest3.CodedUITestMethod1() in c:\TFS\DOTNETConcepts\Code\CodedUITestConcepts\CodedUITestConcepts\CodedUITest3.cs:line 30