martinp999
15 years agoNew Contributor
Menu.Click() inconsistency
Is there any way to make the Menu.Click method more consistent?
I am on TestComplete 5 and am driving some context menus that come up when right-clicking on items in the Windows Explorer list. The function does not visually appear to move the mouse correctly as stated in the help (may be related to the fact that these menu have dividers between some items?), but this is probably insignificant because it manages to trigger the click event on the correct menu item... about 98% of the time.
It is the 2% of the time that it fails to trigger the menu item that is frustrating. In these cases it throws no errors but the event is not fired.
I have tried using both menu labels "third menu item|second sub-menu item" and indexes "[3]|[2]", but that does not seem to improve reliability much.
I suspect that, if I were somehow able to put some waits into the Menu.Click method itself, reliability would improve. Is there any way to do this?
Thanks
Martin
I am on TestComplete 5 and am driving some context menus that come up when right-clicking on items in the Windows Explorer list. The function does not visually appear to move the mouse correctly as stated in the help (may be related to the fact that these menu have dividers between some items?), but this is probably insignificant because it manages to trigger the click event on the correct menu item... about 98% of the time.
It is the 2% of the time that it fails to trigger the menu item that is frustrating. In these cases it throws no errors but the event is not fired.
I have tried using both menu labels "third menu item|second sub-menu item" and indexes "[3]|[2]", but that does not seem to improve reliability much.
I suspect that, if I were somehow able to put some waits into the Menu.Click method itself, reliability would improve. Is there any way to do this?
Thanks
Martin