TestStack / White

DEPRECATED - no longer actively maintained
Other
1.02k stars 485 forks source link

Menu.SubMenu() call frequently takes up to 45 minutes to return #636

Open jeffhuckins opened 5 years ago

jeffhuckins commented 5 years ago

It is really pretty weird, but the same code that worked flawlessly before my vacation now hangs for up to 45 minutes or more. I created my own MenuClick() method for our tests because the standard MenuBar.MenuItem() method frequently hung as well when navigating to past 2nd level menu items. My method worked fine before my vacation, as I said.

Anyway, now, the Menu.SubMenu() call frequently takes 45 minutes or more to complete, which is unacceptable.

An additional bit of weirdness is that the test code clicks 3rd level menuitems in pairs, where they both open a Browse For Folder dialog. The first to select a source folder and the other to select a destination folder. The "hang" ONLY occurs (so far) when attempting to get the 2nd level submenu for the second in the pair of 3rd level menuitem clicks.

Turns out that if I sleep between the pair of menu operations for 10s, it works just fine. This seems to tell me that White's busy wait mechanism isn't working properly.

Here is my code (mainMenu is a MenuBar object):

` menu = mainMenu.MenuItem(menuItems[0]);

                for (int i = 1; i < menuItems.Length; i++)
                {
                    log.Info($"Setting submenu '{menuItems[i]}'");
                    menu = menu.SubMenu(menuItems[i]);
                    log.Info($"Set submenu");

                    if (menu != null)
                    {
                        log.Info($"Clicking menu item");
                        menu.Click();
                        log.Info($"Clicked menu item");
                    }
                    else
                    {
                        log.Info("mainMenu is null!!!");
                        break;
                    }
                }

`

jeffhuckins commented 5 years ago

I implemented my own menu action code because I thought that passing the full path to the target menu item was failing, when in fact, it also was susceptible to this LONG turnaround for getting submenus.

jeffhuckins commented 5 years ago

Another update. I started my tests Friday late morning and left for the weekend. This time, there was one iteration I described that returned almost 2 hours after invoking the SubMenu() call.