Forum Discussion
Hi there,
I edited my initial message and added some screenshots.
I added Event for errors:
function GeneralEvents_OnLogError(Sender, LogParams)
{
if ((LogParams["Str"] == "The window was destroyed during method execution.") ||
(LogParams["Str"] == "Cannot find the submenu for the '?' menu item.")) {
LogParams["Locked"] = true;
Aliases.MyApp.WaitAliasChild("MainForm", -1).MainMenu.Click(Project.Variables.selectMenu);
}
}
So, now when errors appear it tries to select menu one more time - until it is selected.
BUT, now I see that there can be no errors and menu is not selected, still.
So, I added
do while (menu is selected)
function, not too great solution, but I believe it will work OK....
That would be great to know anyway, is there any GOOD solution, and not one I implemented recently.
Hi,
You might consider to consult with developers to check the following idea:
-- It is possible that sub-menu and its items are created dynamically and only after the corresponding parent menu item is clicked or hovered to expand;
-- If the above is the case, you may consider not to click menu by its full path using default TestComplete's functionality, but implement it manually;
-- In your manual implementation, for every but final menu item, test code must: a) hover mouse over the menu item; b) click the hovered menu item or just wait until the sub-menu appears (this may depend on the implementation); c) search for the next menu item in the sub-menu window. The last menu item should be just clicked.
Hope, this might help.
- sergeys10 years agoContributor
Hi Alex,
Thanks for reply, I will definetely try what you said.
I had to avoid choosing menues cause I needed to find solution FAST - I used navigation pane items instead, which is implemented in the application I test. But I will turn back to menues at some point later.
Thanks,
Sergey