locked
Coded Ui test unable to find the WPF Ribbon button RRS feed

  • Question

  • Hi, 

    I have WPF application in which WPF Ribbon control is used. When try to automate the WPF application i  unable to find the ribbon SplitButton. 

    Is there any way find the SplitButton and trigger the click ? 

    I am using VS 2010. 


    Tuesday, January 29, 2013 3:49 PM

Answers

All replies

  • Hello Bdnp,

    Thank you for your post.

    When try to automate the WPF application i unable to find the ribbon SplitButton.

    Can you clarify it so that we can further look at this issue?

    I suggest that you can drag the crosshair of Coded UI Test Builder on the SplitButton to check if Coded UI can recognize it well. If it can’t be identified well, I am afraid that the Coded UI does not support this control. You need to write extension to enable coded UI to recognize this control.

    Refenrece: Supported Configurations and Platforms for Coded UI Tests and Action Recordings

    Series on Coded UI Test Extensibility

    If the coded UI can identify the Ribbon control well, I would like to know if you have recorded a coded UI test on ribbon SplitButton control and get some errors(control can’t be found) when you run the test. If yes, please provide us detailed error messages so that we can further look at this issue.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, January 30, 2013 3:54 AM
  • Hi Amanda,

    Thanks for your valuable inputs.

    I have following structure of ribbon control

    Riobbonbar

           RibbonTab

                  RibbonButton

    Now, here the crosshair of Coded UI Test Builder only identify the ribbon bar and identifies the header text of the ribbon tab.    

    ribbon bar identified as "control Type =TabList" and class Name "Uia.Ribbon" and it has a automation ID 

    The ribbon tab header is identified  as "Control Type=Header" and class Name "Uia.RibbonTabHeader"

    The crosshair of Coded UI Test Builder does not identify the RibbonButton

    Any idea why ribbon button are unable to identify by Coded UI Test Builder

    FYI  : XMAL is more less similar to below

    <ribbon:Ribbon x:Name="Ribbon">
                <ribbon:Ribbon.ApplicationMenu>
                    <ribbon:RibbonApplicationMenu SmallImageSource="Images\SmallIcon.png">
                        <ribbon:RibbonApplicationMenuItem Header="Hello _Ribbon" x:Name="MenuItem1" ImageSource="Images\LargeIcon.png"/>
                    </ribbon:RibbonApplicationMenu>
                </ribbon:Ribbon.ApplicationMenu>
                <ribbon:RibbonTab x:Name="HomeTab" Header="Home" AutomationProperties.AutomationId="myTab">
                    <ribbon:RibbonGroup x:Name="Group1" Header="Group1" AutomationProperties.AutomationId="myGroup">
                        <ribbon:RibbonSplitButton x:Name="Button1" LargeImageSource="Images\LargeIcon.png" Label="Button1" AutomationProperties.AutomationId="mySplitButton">
                            <ribbon:RibbonSplitMenuItem x:Name="Button21" Header="SubMenu" Click="Button21_Click" AutomationProperties.AutomationId="mySubMenu" />
                        </ribbon:RibbonSplitButton>
                    </ribbon:RibbonGroup>
                </ribbon:RibbonTab>
            </ribbon:Ribbon> 

    Kindly Share your thoughts on this.

    • Edited by bdnp Thursday, January 31, 2013 6:32 AM
    Thursday, January 31, 2013 6:30 AM
  • Hello Bdnp,

    If the Coded UI Test Builder does not identify the RibbonSplitButton control, I am afraid that you can’t do Coded UI test with this control.

    Moreover it seems many people encountered this issue. Please reference these threads with the same issue:

    http://social.msdn.microsoft.com/Forums/en/vsautotest/thread/3faf9c53-e3e4-4e20-8328-09afda05c754

    http://social.msdn.microsoft.com/Forums/en-US/windowsribbondevelopment/thread/fb82ab84-c00c-46fe-9af8-89f06ff049fb

    As ThejKumar said, he is also able to reproduce this issue. And he is tracking it on his end and will update the result of the investigation.

    I also do a research and don’t find some latest information for this issue. I think that maybe this issue is under investigation. There might be some time delay. Appreciate your patience.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Edited by Amanda Zhu Thursday, January 31, 2013 7:02 AM
    • Marked as answer by Amanda Zhu Wednesday, February 6, 2013 10:01 AM
    Thursday, January 31, 2013 7:02 AM
  • Hello Bdnp,

    I am marking my reply as answer. If my suggestion can’t help you, you can come back and unmark it as answer. If you have anything unclear, please feel free to come back and ask me.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, February 6, 2013 10:02 AM