Example #1
0
 public virtual Window FindModalWindow(string title, Process process, InitializeOption option, AutomationElement parentWindowElement,
     WindowSession windowSession)
 {
     var windowFinder = new AutomationElementFinder(parentWindowElement);
     try
     {
         AutomationElement modalWindowElement = WaitTillFound(delegate
                                                                  {
                                                                      AutomationElement windowElement = windowFinder.FindWindow(title, process.Id) ??
                                                                                                        finder.FindWindow(title, process.Id);
                                                                      return windowElement;
                                                                  }, "Could not find modal window with title: " + title);
         return Create(modalWindowElement, option, windowSession);
     }
     catch (UIActionException e)
     {
         WhiteLogger.Instance.Debug(e.ToString());
         return null;
     }
 }
Example #2
0
 public virtual Window FindModalWindow(SearchCriteria searchCriteria, InitializeOption option, AutomationElement parentWindowElement, WindowSession windowSession)
 {
     var windowFinder = new AutomationElementFinder(parentWindowElement);
     try
     {
         AutomationElement modalWindowElement = WaitTillFound(() =>
         {
             AutomationElement windowElement = windowFinder.FindWindow(searchCriteria) ??
                 Finder.FindWindow(searchCriteria);
             return windowElement;
         }, "Could not find modal window with SearchCriteria: " + searchCriteria);
         return Create(modalWindowElement, option, windowSession);
     }
     catch (UIActionException e)
     {
         logger.Debug(e.ToString());
         return null;
     }
 }