mmcdonald
15 years agoOccasional Contributor
unreliable popup menus
Hi there,
I am using testcomplete 7.52 and have a problem addressing popup menus. I am trying to open a right click menu on a table cell and then select "options->format cells" to open a dialog box. I have tried using mouse clicks eg:
Call tableedit.ClickR(23, 25)
Call Designer.pm_context.menu_item3.Click 'click "options"
Call Designer.pm_options.menu_item2.Click 'click "format cells"
I have noticed for different instances of the test, the menu is sometimes recognised differently to testcomplete despite the menu being identical each time (called from the same test, same number of items, same names) and so testcomplete is unable to select "options". In my NameMapping for the project I have three items:
-NameMapping.Sys.Designer.pm_context.menu_item3
-NameMapping.Sys.Designer.pm_context.menu_item4
-NameMapping.Sys.Designer.pm_context.menu_item5
where the objects are identical except for the ControlIndex property and it seems almost random when each will work as the "options" item during test execution.
I have also tried doing it with key presses and selecting the 22nd option in the menu, then the third option (options is always 22nd and format cells is 3rd):
Call Tableedit.Keys["Apps"]
Designer.pm_context.Keys("[down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][right][down][down][enter]")
however using this method I get an error "the window was destroyed during method execution".
any ideas on what may be happening and what I can do to reliably select this menu option every time?
I am using testcomplete 7.52 and have a problem addressing popup menus. I am trying to open a right click menu on a table cell and then select "options->format cells" to open a dialog box. I have tried using mouse clicks eg:
Call tableedit.ClickR(23, 25)
Call Designer.pm_context.menu_item3.Click 'click "options"
Call Designer.pm_options.menu_item2.Click 'click "format cells"
I have noticed for different instances of the test, the menu is sometimes recognised differently to testcomplete despite the menu being identical each time (called from the same test, same number of items, same names) and so testcomplete is unable to select "options". In my NameMapping for the project I have three items:
-NameMapping.Sys.Designer.pm_context.menu_item3
-NameMapping.Sys.Designer.pm_context.menu_item4
-NameMapping.Sys.Designer.pm_context.menu_item5
where the objects are identical except for the ControlIndex property and it seems almost random when each will work as the "options" item during test execution.
I have also tried doing it with key presses and selecting the 22nd option in the menu, then the third option (options is always 22nd and format cells is 3rd):
Call Tableedit.Keys["Apps"]
Designer.pm_context.Keys("[down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][down][right][down][down][enter]")
however using this method I get an error "the window was destroyed during method execution".
any ideas on what may be happening and what I can do to reliably select this menu option every time?