Forum Discussion

fuulrkwl's avatar
fuulrkwl
New Contributor
10 years ago

Recognition of TdxRibbonPopupMenu component

Hello,



any chance a TdxRibbonPopupMenuControl component is recognized correctly by TestComplete? It is a VCL component from Developer Express (the language is Delphi). You can find and download an application example in this discussion (https://www.devexpress.com/Support/Center/Question/Details/Q472215), also, see the screenshot attached.



Actually, recording actions over the component result in relative coordinate clicks. Any way in order to let TestComplete identify each item of the component?



Best Regards
  • Hi John,



    TestComplete doesn't specifically support galleries in TdxRibbon. You can automate them by using the native methods and properties of gallery objects, such as setSelected() that you mentioned. To learn which methods and properties you can use, explore the ribbon and gallery objects in the Object Browser, or refer to the documentation on DevExpress VCL ExpressBars (you can download the docs here).



    You can also submit a feature request for adding record & playback support for galleries in TdxRibbon:

    http://support.smartbear.com/testcomplete-survey/

5 Replies

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi John,



    Actually, TestComplete supports DevExpress TxdRibbon. You need to do the following:



    1. Build your application with debug information. The sample app you linked to already has debug info.

    2. Go to Tools > Current Project Properties > Object Mapping.

    3. Expand the Developer Express Controls > VCL > BarDockControl > SubMenuControl group.

    4. Add TdxRibbonPopupMenuControl to this group.

    5. Save the project.



    Now TestComplete will record item selection from the popup menu like this:



    function Test1()

    {

      var tdxRibbon = Sys.Process("Project1").VCLObject("Form1").VCLObject("dxRibbon1");



      tdxRibbon.ClickItem("dxRibbon1Tab1|Custom 1|dxBarLargeButton1|dxBarButton1");

      tdxRibbon.ClickItem("dxRibbon1Tab1|Custom 1|dxBarLargeButton1|dxBarButton2");

    }

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi John,



    TestComplete doesn't specifically support galleries in TdxRibbon. You can automate them by using the native methods and properties of gallery objects, such as setSelected() that you mentioned. To learn which methods and properties you can use, explore the ribbon and gallery objects in the Object Browser, or refer to the documentation on DevExpress VCL ExpressBars (you can download the docs here).



    You can also submit a feature request for adding record & playback support for galleries in TdxRibbon:

    http://support.smartbear.com/testcomplete-survey/
  • fuulrkwl's avatar
    fuulrkwl
    New Contributor
    Hi Helen,



    thanks for the answer. In this example, this solution works well. But in the real application we are trying to test, things are more complex. In particular, the elements of the TdxRibbonPopupMenu are not simple buttons, but they can be other menus or particular TdxRibbonGalleryItem.



    I am sorry that i cannot provide any example with the real application nor i remember the various class names of the objects that compose the popup menu, we have opened a ticket with the support center for this.



    What happens in the real application is that we cannot go deep in the menus, but only in the "first level" even using your solution. For example, if you take a look at this example picture found online ( http://www.devcomponents.com/dotnetbar-wpf/img/WpfGalleryDropDown.png ), if we try to record the click on the second element of the "office" submenu, we obtain a click relative to the entire submenu (the submenu "office"), and not a click relative to the second element. This means that if the second element changes its position, the test will click whatever will get its place.



    Do you have any idea on what the problem can be? Also, are the TdxRibbon 100% supported or there are elements that are not? Because, for example, a similar problem happens with the class TdxRibbonDropDownGalleryControl, which contains some element that, when clicked, generate others TdxRibbonDropDownGallery items, and also in this case we can only record coordinate clicks relative to the entire menu.



    Best Regards
  • fuulrkwl's avatar
    fuulrkwl
    New Contributor
    Hello,



    here are the progress so far. I found another image online here (https://www.devexpress.com/Products/VCL/ExBars/i/features/ribbon/galleries.png) which is something similar to our application popup menu.



    The chain of classes in our application, from the popup menu to the single elements of the menu itself, is:



    TdxRibbonPopupMenuControl -> TdxBarSubMenuControlItemLinks -> TdxBarItemLink -> TdxRibbonGalleryItem -> TdxRibbonGalleryGroups -> TdxRibbonGalleryGroup -> TdxRibbonGalleryGroupItems -> TdxRibbonGalleryGroupItem.



    Those are quite a lot of classes and none of them seems to be supported by TestComplete. The popup menu is composed of smaller group items similar to the submenus shown in the linked picture, where you can see the "Basic Math" and "Greek Letter" submenus.



    There are some components of the menu that are correctly recognized (that is, TestComplete manages to record coordinate click relative to the single items), while others that are not recognized by the application.



    I found out that the elements that are not correctly identified can be clicked via script via the following chain (using Debug information): TdxRibbon.BarManager.Items(x).GalleryCategories.Items(y).Items.Items(z).setSelected(true), while for the other elements correctly recognized there is no need to go through the GalleryCategories step. Can this be the problem?





    Can someone direct me towards the road to follow to look for a solution?



    Thanks in advance.


  • fuulrkwl's avatar
    fuulrkwl
    New Contributor
    Hi Helena,



    thanks, this is the answer we were looking for. At least we know it was not our fault that we didnt managed to let TestComplete recognize those components properly. We already have managed to write a script that finds and clicks items in the gallery.



    Best Regards