This is a migrated thread and some comments may be shown as answers.

Coded UI Test error for GridView

3 Answers 89 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ruban
Top achievements
Rank 1
Ruban asked on 07 Apr 2014, 04:55 PM
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

3 Answers, 1 is accepted

Sort by
0
Yordanka
Telerik team
answered on 08 Apr 2014, 11:58 AM
Hello Ruban,

Can you test your scenario with the latest internal binaries - version 2014.1.0407? Let me know if the problem still occurs.

Regards,
Yordanka
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Ruban
Top achievements
Rank 1
answered on 08 Apr 2014, 05:19 PM
I have updated it as per suggestion and put the latest file in the correct folder as well as refer to the latest binaries for the controls in my application.
However, after recording a button click action in the WPF application, then building my unit tests aren't showing up in the Test Explorer.
In my test outputs, I have the following error:
Unable to load types from the test source 'C:\TFS\DOTNETConcepts\Code\CodedUITestProject1\CodedUITestProject1\bin\Debug\CodedUITestProject1.dll'. Some or all of the tests in this source may not be discovered. If you are running unit tests for Windows Store apps and referencing custom WinMD type then please visit http://go.microsoft.com/fwlink/?LinkId=238340 for more info. Error details: System.IO.FileNotFoundException: Could not load file or assembly 'Telerik.VisualStudio.TestTools.UITest.Extension.ExtensionsCore, Version=2014.1.331.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The system cannot find the file specified.
0
Yordanka
Telerik team
answered on 11 Apr 2014, 09:08 AM
Hi Ruban,

I attached a sample project with the test. The application and the test project refer WPF40 binaries. Could you give it a try on your side? Do you still experience the problem?

Regards,
Yordanka
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Ruban
Top achievements
Rank 1
Answers by
Yordanka
Telerik team
Ruban
Top achievements
Rank 1
Share this question
or