I've got an issue on my desktop app; the click on a sub-menu belonging to the class ContextMenuStrip doesn't work. I'll try to give you some information, but ask me if you need other details.
The issue is related to a menu that is displayed after doing a right-click on a treeView. As example, this is the structure : Parent |_Child1
|_ Child4 If the Child4 is right-clicked, a submenu (it belongs to ContextMenuStrip class) appears, with the following structure: - New - Delete - Update Then, if the New item is clicked (or on mouse over), another menu appears (it belongs to ToolStripDropDownMenu class) and I want, at the end, to click on one element of this menu.
The actual code correctly executes the right-click, but then it stops, with an error when it has to click on the first submenu (on New item for example).
I've tried to record it and this is the generated code (VBScript):
Set EDashBoard = Aliases.EDashBoard
Set tabControl = EDashBoard.HwndSource_ribbonwindow.WinFormsAdapter.SystemConfiguratorMainForm.toolStripContainer1.ToolStripContentPanel.splitContainer1.SplitterPanel2.splitContainer2.SplitterPanel.tcMain
Call EDashBoard.ContextMenuStrip.Click(40, 19)
Call EDashBoard.ToolStripDropDownMenu.Click(85, 127)
But later if I execute the recorded test, it doesn't work. This is the error generated: "The object "ContextMenuStrip" does not exist" and the error appears on ContextMenuStrip.Click row.
I've tried to click it using both the FullName or the Alias into the code (and not the recorded code), but it doesn't work.
Morever, I cannot find the object by Id because it seems a dynamic object (the Id changes every time the menu is opened).
The strange thing is that: if I use the Object Spy with Point and Fix and try to open it into the Object Tree, the following error appear "Unable to highlight this object tree, because it does not exist".
Can you let us know how ContextMenuStrip and ToolStripDropDownMenu are NameMapped?
Regards, /Alex [Community Hero] ____ [Community Heroes] are not employed by SmartBear Software but are just volunteers who have some experience with the tools by SmartBear Software and a desire to help others. Posts made by [Community Heroes] may differ from the official policies of SmartBear Software and should be treated as the own private opinion of their authors and under no circumstances as an official answer from SmartBear Software. The [Community Hero] signature is used with permission by SmartBear Software. https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame ================================