Forum Discussion

santoguya's avatar
santoguya
Contributor
15 years ago

Generating a button click action for a third party plugin button/control

Hi,



I am using a Component One menu (which is a supported plugin according to TestComplete) which has several Component One Tabs and Buttons. When I record and click on the tabs and buttons, instead of recording a ClickButton action on a windows button, I get a Click action recorded with a mouse coordinate (x,y). I do not want to record a mouse location because the test could be running on different OS's with different resolutions so I am afraid the button wont always be pressed in the right spot.



Is there a way to script a clickbutton action for a third party button? I have successfully scripted a tab click by doing soemthing like:



Call Aliases.ComponentOneMenu.set_SelectedTabIndex(1) to go to the first tab



but I cannot find any actions (while recording) or function calls (in scripting) to click a button on the component one menu without creating a click mouse coordinate action.



Is this possible or is there another approach to this problem?



Thanks!

3 Replies


  • Hi Randy,





    It seems that the menu control used in your application is actually a custom control inherited from the ComponentOne C1MainMenu control. If this is the case, please let me know the value of the C1.Win.C1Command.C1Commands property of the control.





    Also, please let me know which exactly version of TestComplete you have.
    • mithileshmaurya's avatar
      mithileshmaurya
      Occasional Contributor

      Hi I am working on a C1MainMenu.

      I am supposed to click on a menu which opens a list of submenu items .I want to click on one of these submenu items.

      When I record I get something like:

      frmMain["C1MainMenu"]["Click"]("Maintenance|Add Edit Concentration Rating Details");

       

      The above line works perfectly file when the object is used from NameMapping file.

      But if I create the above object through descriptive programing :

      var parent = Aliases["SM"]["frmMain"];
      var arrayprop = new Array("ClrClassName")
      var arrayval = new Array ("C1MainMenu")
      var bla = parent["FindChild"](arrayprop,arrayval,300)
      Log["Message"](bla.Exists) //I get "true" here .If I pass some coorinates it even clicks the menu item so I know that I am using the correct object.I dont want to pass the coorinates because the Submenu is displayed as an object of "MenuPopup".It is difficult to get the coordinates of each submenu item.

       

        bla["Click"]("Maintenance|Add Edit Rating Details");

       

      I get a Type Mismatch error on this line. 

       

       

      Please help.We have started a huge project using the TestComplete desciptive programming, is there a differance in the supported methods for namemapping objects and objects created through descritive programing

      • mithileshmaurya's avatar
        mithileshmaurya
        Occasional Contributor

        I was able to resolve the above issue


        mithileshmaurya wrote:

        Hi I am working on a C1MainMenu.

        I am supposed to click on a menu which opens a list of submenu items .I want to click on one of these submenu items.

        When I record I get something like:

        frmMain["C1MainMenu"]["Click"]("Maintenance|Add Edit Concentration Rating Details");

         

        The above line works perfectly file when the object is used from NameMapping file.

        But if I create the above object through descriptive programing :

        var parent = Aliases["SM"]["frmMain"];
        var arrayprop = new Array("ClrClassName")
        var arrayval = new Array ("C1MainMenu")
        var bla = parent["FindChild"](arrayprop,arrayval,300)
        Log["Message"](bla.Exists) //I get "true" here .If I pass some coorinates it even clicks the menu item so I know that I am using the correct object.I dont want to pass the coorinates because the Submenu is displayed as an object of "MenuPopup".It is difficult to get the coordinates of each submenu item.

         

          bla["Click"]("Maintenance|Add Edit Rating Details");

         

        I get a Type Mismatch error on this line. 

         

         

        Please help.We have started a huge project using the TestComplete desciptive programming, is there a differance in the supported methods for namemapping objects and objects created through descritive programing