none
UI Automation, Ribbon Control and Automation Anywhere 11 in WPF

    Question

  • I am building a new bot in Automation Anywhere 11 and I have found recently a tricky situation when I'm trying to automate the Windows Ribbon.

    If I have only one tab everything works as expected and I can identify all buttons inside, but if I have multiple tabs only the last tab elements are visible to the Object Cloning option, I have added unique Names, AutomationIDs, etc. And nothing has worked. This is a preview of the issue:

    preview1

    This is my example XAML code:

    <UserControl x:Class="Example.RibbonMenu"
    			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    			 mc:Ignorable="d" 
    			 xmlns:my="http://schemas.microsoft.com/winfx/2006/xaml/presentation/ribbon">
    	<my:Ribbon x:Name="R1" AutomationProperties.AutomationId="R1ID">
    		<my:RibbonTab Header="Tab 1" x:Name="Tab1" AutomationProperties.AutomationId="Tab1ID">
    			<my:RibbonGroup x:Name="GB1" AutomationProperties.AutomationId="RG1ID">
    				<my:RibbonButton Label="Button 1" x:Name="RB1" AutomationProperties.AutomationId="RB1ID" />
    			</my:RibbonGroup>
    		</my:RibbonTab>
    		<my:RibbonTab Header="Tab 2" x:Name="Tab2" AutomationProperties.AutomationId="Tab2ID">
    			<my:RibbonGroup x:Name="RG2" AutomationProperties.AutomationId="RG2ID">
    				<my:RibbonButton Label="Button 2" x:Name="RB2" AutomationProperties.AutomationId="RB2ID" />
    				<my:RibbonButton Label="Button 3" x:Name="RB3" AutomationProperties.AutomationId="RB3ID" />
    			</my:RibbonGroup>
    		</my:RibbonTab>
    	</my:Ribbon>
    </UserControl>
    

    Also, I have read multiple options:

    1. UI Automation and Ribbon control
    2. XAML - Binding row and column index of cell to automation ID
    3. Unable to generate Automation ID for WPF Controls, to be used by coded UI for automation testing
    4. How can I find WPF controls by name or type?
    5. Coded Ui test unable to find the WPF Ribbon button
    6. How can i automate Ribbon UI
    But nothing that I tried so far was worked until recently, I identified that the issue is connected to the last tab. Also, I tried the Legacy Option and Manage Windows Controls too. Here are some previews:

    Legacy Option Enabled:

    Manage Windows Controls:

    Furthermore, another ribboned app like Paint where the buttons are recognized:

    Does anyone have an idea how to fix it? Or has experienced something similar? Thanks for your help.


    Federico Navarrete

    Tuesday, May 14, 2019 11:48 AM

All replies


  • Hi   FANMixco,  

    >>If I have only one tab everything works as expected and I can identify all buttons inside, but if I have multiple tabs only the last tab elements are visible to the Object Cloning option, I have added unique Names, AutomationIDs, etc. And nothing has worked. This is a preview of the 

    From your description, your issue is related to the Object Cloning.

    Unfortunately, I have no experience about this. You may can go to the Third-party products support center for getting suitable help.

    Thank you for your understanding.

    Best Regards

    Yong Lu





    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 15, 2019 8:16 AM
  • Hi Yong,

    Thanks for your answer and I agree with it since I have contacted the provider; however, I experienced the same problem with UiPath a couple of months ago, which is a different provider and they use .NET Technologies for the development of their RPA solutions (VB.NET and WWF).

    Also, I'm totally convinced that even if I use BluePrism, AssistEdge, WorkFusion, WinAutomation, etc. I'll get exactly the same results. Therefore, it's an issue of how, the ribbon is built or how my project have been designed because the issue doesn't happen in Windows Forms since any project that I have built and tested on Windows Forms Technology is capable of automation in a blink of an eye without any specific configuration from my side.

    Thanks for your support.


    Federico Navarrete


    • Edited by FANMixco Wednesday, May 15, 2019 8:35 AM
    Wednesday, May 15, 2019 8:34 AM

  • Hi   FANMixco,

    >>herefore, it's an issue of how, the ribbon is built or how my project have been designed 

    You can refer this Ribbon.

    Besides, I found a Third-party open source control:  Fluent.Ribbon. You can refer it and make a test.
     
    Fluent.Ribbon


    Best Regards

    Yong Lu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, May 16, 2019 2:44 AM
  • Hi Yong,

    I'm going to try it, but first I need to discuss that with the team since this is not a small change and I cannot approve it by myself, but I'm a bit skeptical of what I should change in the regular WPF code because why should I rely on a 3rd party control? Because as I said in Windows Forms, there is not that issue of Object Cloning under no circumstances.

    However, I cannot rebuild a massive tool to that technology that is not even responsive; therefore, when Office or Paint were built or any other MS ribboned tool, something has been enabled that I'm unaware because there is not enough documentation about this topic of the AutomationProperties and as I said before they work with flying colors in all RPA tools, but if you create a small project with only the ribbon, it only works in the last tab as in the examples, which is somehow odd.


    Federico Navarrete






    • Edited by FANMixco Thursday, May 16, 2019 3:09 AM
    Thursday, May 16, 2019 3:06 AM
  • Hi Yong,

    I tested another Microsoft Tool: AccExplorer32.exe and it shows exactly the same behaviour as Automation Anywhere that it cannot find the buttons or anything in any other tab that is not the last one, here you have a preview:

    Therefore, this cannot be an issue of the RPA Tools or Object Cloning, but as I said before of how the ribbonned program has been programmed from my side.


    Federico Navarrete




    • Edited by FANMixco Friday, May 17, 2019 12:15 PM
    Friday, May 17, 2019 12:07 PM
  • Hi Yong Lu,

    Can you explain me why this is not a WPF question? Since this is an Issue of WPF as I showed based on a Microsoft Tool (AccExplorer32.exe) and not only in Automation Anywhere or UiPath.

    I believe this question should come back to the WPF forum. Thanks.


    Federico Navarrete



    • Edited by FANMixco Tuesday, June 4, 2019 10:22 AM
    Tuesday, June 4, 2019 10:21 AM
  • Hi FANMixco,    

    In fact, the Ribbon Control itself is normal, if you need the function, I suggest you can visit theDeveloper Community and suggest a feature.


    Best regards

    Yong Lu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 5, 2019 1:38 AM
  • Hi Yong,

    To prove that this is a programming issue, I was able to find an example with Window Forms:

    https://bernhardelbl.wordpress.com/2010/11/17/quickstart-tutorial-windows-ribbon-for-winforms/

    It took me a while since there is no proper support from Microsoft side, but this example is based on the Windows SDK ribbon not a third party control and now, it works as expected as I always said any Window Forms project works properly since the first time.

    Hopefully, you can return it to the WPF Forum, therefore, someone would be able to provide some input about it. Thanks.


    Federico Navarrete

    Thursday, June 6, 2019 9:20 AM