Ejemplo n.º 1
0
        public static void WaitReadyState()
        {
            Contract.Assume(WebDriver != null);

            var ready = new Func <bool>(() => (bool)ExecuteJavaScript("return document.readyState == 'complete'"));

            Contract.Assert(WaitHelper.SpinWait(ready, TimeSpan.FromSeconds(60), TimeSpan.FromMilliseconds(100)));
        }
Ejemplo n.º 2
0
        public static void WaitAjax()
        {
            Contract.Assume(WebDriver != null);

            var ready = new Func <bool>(() => (bool)ExecuteJavaScript("return (typeof($) === 'undefined') ? true : !$.active;"));

            Contract.Assert(WaitHelper.SpinWait(ready, TimeSpan.FromSeconds(60), TimeSpan.FromMilliseconds(100)));
        }
Ejemplo n.º 3
0
        public static void AcceptAlert()
        {
            var accept = WaitHelper.MakeTry(() => WebDriver.SwitchTo().Alert().Accept());

            WaitHelper.SpinWait(accept, TimeSpan.FromSeconds(5));
        }