12 years ago
Cannot select ContextMenuStrip by Caption or index.
Hi,
I'm having some problems with ContextMenuStrips in TC 9.3. I recorded a keyword test that starts my application, right clicks and then selects the exit menu item in the resulting context menu. Unfortunately, the item is selected by coordinates instead of by caption, which the documentation says is the default.
After conversion to C++script and some editing, it looks like this:
Aliases["MyApp"]["ViewportView"]["xxxWidget"]["ClickR"](832, 407);
var contextMenu = Sys["Process"]("MyApp")["WinFormsObject"]("contextMenuStrip");
contextMenu.Click(20, 20); // <== works
contextMenu.Click("Exit"); // <== type mismatch
The contextMenu object is well-formed and has a ClrFullClassName of System.Windows.Forms.ContextMenuStrip. Similarly, contextMenu.Items is of type System.Windows.Forms.ToolStripItemCollection and has the correct number of items (6, including separators).
Any suggestions on what I'm doing wrong? Thanks!
I'm having some problems with ContextMenuStrips in TC 9.3. I recorded a keyword test that starts my application, right clicks and then selects the exit menu item in the resulting context menu. Unfortunately, the item is selected by coordinates instead of by caption, which the documentation says is the default.
After conversion to C++script and some editing, it looks like this:
Aliases["MyApp"]["ViewportView"]["xxxWidget"]["ClickR"](832, 407);
var contextMenu = Sys["Process"]("MyApp")["WinFormsObject"]("contextMenuStrip");
contextMenu.Click(20, 20); // <== works
contextMenu.Click("Exit"); // <== type mismatch
The contextMenu object is well-formed and has a ClrFullClassName of System.Windows.Forms.ContextMenuStrip. Similarly, contextMenu.Items is of type System.Windows.Forms.ToolStripItemCollection and has the correct number of items (6, including separators).
Any suggestions on what I'm doing wrong? Thanks!