Coded UI Test error for GridView

4 posts, 0 answers
  1. Ruban
    Ruban avatar
    4 posts
    Member since:
    Dec 2013

    Posted 07 Apr 2014 Link to this post

    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
  2. Yordanka
    Admin
    Yordanka avatar
    634 posts

    Posted 08 Apr 2014 Link to this post

    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.

     
  3. Ruban
    Ruban avatar
    4 posts
    Member since:
    Dec 2013

    Posted 08 Apr 2014 in reply to Yordanka Link to this post

    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.
  4. Yordanka
    Admin
    Yordanka avatar
    634 posts

    Posted 11 Apr 2014 Link to this post

    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.

     
Back to Top