UI Automation

9 posts, 0 answers
  1. p-h
    p-h avatar
    9 posts
    Member since:
    Jul 2018

    Posted 24 Jul 2018 Link to this post

    Recently I contacted Telerik regarding the ability of End2End tests over the WPF app which uses Telerik controls.
    I used to work with TestStack.White framework previously but encountered some issues while trying to automate
    Telerik controls.
    After that I asked Telerik about support for TestStack.White and Telerik replied that this framework is not guaranteed to be supported.
    And recommended me to use either CodedUI or your own framework claiming that both are supported by your controls.
    That’s why I switched to CodedUI.

    I've been struggling to automate controls inside the diagrams on canvas (all being Telerik controls)
    Our app contains RadDiagram and controls that inherit from RadDiagramShape.

    I succeed to get the shapes and test them in the code, but can’t access to the nested items, under the shapes.






    Itried to implement control automation both in code using WpfCustom API and via CodedUI Test Builder.
    In both case Igot the same error of being unable to find the control by its automation id.
  2. Peshito
    Admin
    Peshito avatar
    585 posts

    Posted 27 Jul 2018 Link to this post

    Hello,

    This seems like an issue related to the hierarchy of the control. Default hierarchy level is 2, which means that the look for 2 levels up from control’s immediate ancestor [parent of the control in Coded UI]. This can be solved by editing the CodedUITestBuilder.exe.config file and change the MaxLevelsForItemContainer property with a higher value. This issue and the fix are well described in the article below:
    How to test deep hierarchy controls using Coded UI Test in WPF?
     
    Please give this approach a try. In case this does not work, please attach the sample runnable project you are working on, or one that reproduces the issue. As this is a support thread, you might use a third party web site for files sharing.

    Regards,
    Peshito
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. p-h
    p-h avatar
    9 posts
    Member since:
    Jul 2018

    Posted 01 Aug 2018 in reply to Peshito Link to this post

    Hello,

    I changed the MaxLevelsForItemContainer property, I attached the config file. this helped for some times, and then the CodedUI again can't access to the nested items.

    I wrote a sample project. Here's the link to it: https://github.com/horowitzp/SampleProject.git. I hope it's understandable.

    I also added the CodedUITestBuilder.exe.config file to the project.

    Thank you!

  4. p-h
    p-h avatar
    9 posts
    Member since:
    Jul 2018

    Posted 01 Aug 2018 in reply to p-h Link to this post

    Sorry, this is the right link:

    https://github.com/horowitzp/Project_Telerik.git

  5. Peshito
    Admin
    Peshito avatar
    585 posts

    Posted 02 Aug 2018 Link to this post

    Hi,

    Thank you for sharing the sample project. It looks like the reason for the CodedUI not being able to locate the elements is caused by the way the custom diagram shapes are created. I checked the Elements' tree with Visual UI Automation Verify tool and no children elements are being found, but only the CustomElement. This is also reproducible if you have diagram shape inside a diagram shape. Could you try not creating the sub elements as direct siblings of the custom diagram shape but inside a border or stack panel?

    Regards,
    Peshito
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  6. p-h
    p-h avatar
    9 posts
    Member since:
    Jul 2018

    Posted 08 Aug 2018 in reply to Peshito Link to this post

    Hello,

    Thanks for the response,

    I tried to wrap the sub elements with border as you can see in the sample project that I had sent (the change is in file - MainWindow.xaml) but I still have the problem. 

    <Setter Property="ContentTemplate">
       <Setter.Value>
          <DataTemplate>
             <Border>
                <local:CustomElementView DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:CustomDiagramShape}}, Path=DataContext}"/>
             </Border>
          </DataTemplate>
       </Setter.Value>
    </Setter>

    Do you have another solution to my problem?

  7. Dmitry
    Dmitry avatar
    6 posts
    Member since:
    Jun 2018

    Posted 11 Aug 2018 Link to this post

    @Peshito

    I tried the proposed solution and the outcome is the same.

    Moreover I switched to the regular RadDiagram and RadDiagramShape with only a button as ContentTemplate and the result is the same: The UIAVerify tool doesn't see the contents of the shapes.

    Do you have a working sample of visual tree which uses RadDiagram/Custom Diagram and is visible by UIAVerify tool?

    This is urgent as I'm stuck on this feature that was said to have out-of-the-box support.

     

    Thanks in advance.

     

     

  8. Peshito
    Admin
    Peshito avatar
    585 posts

    Posted 13 Aug 2018 Link to this post

    Hi Dmitry,

    I forwarded this to our developers for further investigation. I will write you back with more information on the matter not later then tomorrow.

    Regards,
    Peshito
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  9. Peshito
    Admin
    Peshito avatar
    585 posts

    Posted 13 Aug 2018 Link to this post

    Hello Dmitry,

    After further investigating the issue it turns out that this is a bug in RadDiagram's automation peers. The issue is now logged in our feedback portal -  DiagramShape's child automation peers are not present in the automation tree when the shape's ContentTemplate is used. You can track its progress by subscribing to it. The fix will most likely be part of the next LIB (Latest Internal Build).

    Regards,
    Peshito
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top