Example on using WaitTill Method

Mar 10, 2009 at 1:40 PM

Hi All,

     Could some one let me know how to use WaitTill Method....

 Scenario: After clicking on a Button I get a Modal ChildWindow, I need to wait until i get that window.
The problem is i am using sleeps to wait for the window appears, I know it is not a reliable solution,  please suggest an alternative...

Thanks In Advance..
CS
Mar 10, 2009 at 8:45 PM
You could try to get the modal window using the ModalWindow method. This would pause the test until the window appeared, or the search timed out. Such as:

_myWindow.ModalWindow("My modal window");
// continue with test

WaitTill could be used as follows... if you really wanted to:

_myWindow.WaitTill(()=> _myWindow.ModalWindows().Count == 1);
// continue with test

I use WaitTill more for checking the enabled and visible states of UIItems that the next step of a test depends on as a cue to be able to continue.