Forum Discussion

RajeshVV's avatar
RajeshVV
Contributor
8 years ago

Unable to traverse through the elements of "TdxBarSubMenuControl" submenu type control

I'm dealing with Delphi controls where I need to click on a element from the displayed SubMenu. Able to traverse through the elements whereas I'm unable to click on the required control

 

Upon clicking the following control the pop-up from the attachment is displayed

 

set TestObj = Sys.Process("DevWin")._
VCLObject("frmMain").VCLObject("bsvMainApplication")._
VCLObject("tsBackstageControlPanel").VCLObject("fmeBackstageControlPanel")._
VCLObject("gbMain").VCLObject("gbColumnLeft").VCLObject("sbColumnLeft")._
VCLObject("grpDatabase").VCLObject("btnDatabaseSelection")


 

 

 

I tried all the possible combinations and was unable to click on the required menu item

 

 

 

  • Have you mapped your actual control?  You have the button itself and you're clicking on it... but the TdxBarSubMenuControl I don't see in your path to your objects.  

     

    So...  note the question marks:

    set TestObj = Sys.Process("DevWin")._
    VCLObject("frmMain").VCLObject("bsvMainApplication")._
    VCLObject("tsBackstageControlPanel").VCLObject("fmeBackstageControlPanel")._
    VCLObject("gbMain").VCLObject("gbColumnLeft").VCLObject("sbColumnLeft")._
    VCLObject("grpDatabase").VCLObject("btnDatabaseSelection").???????.ClickItem('Default1');

     

     

    I don't know if that's the right place for it, but somewhere in your application is a VCLObject for that TdxBarSubMenuControl.  That object, whatever it is, has the ClickItem method associated with it.

    For more information, see https://support.smartbear.com/testcomplete/docs/reference/test-objects/controls/desktop/dev-express/vcl/bars/index.html

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    This looks like an owner drawn component... I've run into these before in Delphi applications.  You can't necessarily click by caption because the caption is not populated until the objects are drawn. 

     

    Have you tried 

    VCLObject("grpDatabase").VCLObject("btnDatabaseSelection").ClickItem(0)

    Your other option would be to see if the drop down submenu can be mapped and if you can click on the items that way. 

    • RajeshVV's avatar
      RajeshVV
      Contributor

      tristaanogre

       

      Thank you for the info.

       

      Tried both the cases and it throws an error indicating

       

      "Unable to find the object ClickItem(0). See Additional Information for details. 18:50:29 Normal " 

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Have you mapped your actual control?  You have the button itself and you're clicking on it... but the TdxBarSubMenuControl I don't see in your path to your objects.  

         

        So...  note the question marks:

        set TestObj = Sys.Process("DevWin")._
        VCLObject("frmMain").VCLObject("bsvMainApplication")._
        VCLObject("tsBackstageControlPanel").VCLObject("fmeBackstageControlPanel")._
        VCLObject("gbMain").VCLObject("gbColumnLeft").VCLObject("sbColumnLeft")._
        VCLObject("grpDatabase").VCLObject("btnDatabaseSelection").???????.ClickItem('Default1');

         

         

        I don't know if that's the right place for it, but somewhere in your application is a VCLObject for that TdxBarSubMenuControl.  That object, whatever it is, has the ClickItem method associated with it.

        For more information, see https://support.smartbear.com/testcomplete/docs/reference/test-objects/controls/desktop/dev-express/vcl/bars/index.html