Forum Discussion

Dewayne_Pinion's avatar
Dewayne_Pinion
Contributor
10 years ago
Solved

Trying to click on a custom menu

Hello all,

We have a navigator control that is custom in our application that I would like to be able to click on based off of the text for the control. Here are some properties for the control:

 

ClrClassName: NavigatorControl

ClrFullClassname: M3.CustomControls.M3CustomControl.NavigatorControl

 

WndClass: WindowsForms10.Window.8.app.0.21093c0_r39_ad1

WndCaption: Navigator

 

I can click the menu using x,y coordinates but I need to be able to click the items based off of name and not coordinates. I can reference the menu items like so:

 

menu.items.item(0).item_2

 

I do see when I look at the .net methods there are things like btnNew_Click that I believe reference the buttons, but I am not sure how to use these (I am programming in Jscript). The description is:

 

btnNew_Click(System.Object sender, System.EventArgs e);

 

I have also tried adding the wndClass to the text recognition portion of testcomplete and trying that but it cannot seem to find the object when I attempt playback.

 

Any help would be appreciated!

  • HKosova's avatar
    HKosova
    10 years ago

    Try this:

     

    • Go to Tools > Current Project Properties > Object Mapping > Microsoft Controls > WinForms > Strip Toolbar (ToolStrip).
    • Add your class name (M3.CustomControls.M3CustomControl.NavigatorControl) to the list.
    • In all subcategories (ToolStripButton and others), check the Derived Classes check box.

     

    The config should look like this:

    m3-menu-object-mapping.png


    Then try recording the menu selection - is it recorded using item names or coordinates?

7 Replies

    • Dewayne_Pinion's avatar
      Dewayne_Pinion
      Contributor

      Thank you for the link Alex,

      It turns out I tried looking at the menu again after reading a reponse from Helen on another post I had. Adding UI Automation into the project allowed me to reference the controls needed and click them. Problem solved :) Thanks for replying!

      • Dewayne_Pinion's avatar
        Dewayne_Pinion
        Contributor

        Turns out I spoke too soon. During playback I am not getting an error saying there is an overlapping window, even though nothing appears to be there.