Forum Discussion

Martijn_Meijeri's avatar
11 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!

1 Reply

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Martijn,


     


    As far as I can see, David from our TestComplete Support Team is working on your case. Please let us know the results of your investigation!