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!
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:
Then try recording the menu selection - is it recorded using item names or coordinates?