internal static void WaitForAjax(this IWebDriver driver, int secondsToWait = 60)
        {
            var  timeout = new TimeSpan(0, 0, secondsToWait);
            var  sw      = new Stopwatch();
            bool done    = false;

            sw.Start();
            while (!done && sw.ElapsedMilliseconds < timeout.TotalMilliseconds)
            {
                done = JavaScriptExecuter.IsJQueryComplete();

                if (!done)
                {
                    Thread.Sleep(500);
                }
            }
            if (!done)
            {
                throw new TimeoutException("WaitForAjax did not complete within " + secondsToWait + " seconds");
            }
        }
 internal static void ClickAndWait(this IWebElement element)
 {
     JavaScriptExecuter.ScrollToElement(element);
     element.Click();
     DriverManager.Driver.WaitForAjax();
 }
 internal static void ClearAndSendKeys(this IWebElement element, string keys)
 {
     JavaScriptExecuter.ScrollToElement(element);
     element.Clear();
     element.SendKeys(keys);
 }