Ejemplo n.º 1
0
 public bool ElementExists(IWebElement element)
 {
     try
     {
         EstaticWait.Until(d => d.FindElement(By.TagName(element.TagName)));
         return(true);
     }
     catch (TimeoutException)
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
 public void FillElement(IWebElement element, string input)
 {
     if (EstaticWait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(element)).Enabled)
     {
         element.Clear();
         element.SendKeys(input);
     }
     else
     {
         throw new Exception("Element was not visible and couldn't be selected.");
     }
 }
Ejemplo n.º 3
0
        public bool WaitUntilJSReady()
        {
            var jsExec = (IJavaScriptExecutor)driver;

            //Wait for Javascript to load
            bool jsLoad(IWebDriver drivers) => ((IJavaScriptExecutor)driver).ExecuteScript("return document.readyState").ToString().Equals("complete");

            //Get JS is Ready
            bool jsReady = (Boolean)jsExec.ExecuteScript("return document.readyState").ToString().Equals("complete");

            //Wait Javascript until it is Ready!
            if (!jsReady)
            {
                //Wait for Javascript to load
                jsReady = EstaticWait.Until(jsLoad);
            }

            return(jsReady);
        }
Ejemplo n.º 4
0
 public void WatiForLoadScrean()
 {
     EstaticWait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.InvisibilityOfElementLocated(By.XPath(".//div[contains(@class, 'dx-loadindicator')]")));
 }
Ejemplo n.º 5
0
 public bool ElementPresence(IWebElement element)
 {
     return(EstaticWait.Until(d => element.Displayed));
 }
Ejemplo n.º 6
0
 public void ClickOnElement_Javascript(IWebElement element)
 {
     ((IJavaScriptExecutor)driver).ExecuteScript("arguments[0].click();", EstaticWait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(element)));
 }
Ejemplo n.º 7
0
 public void ClickOnElement(IWebElement element)
 {
     EstaticWait.Until(d => !(SeleniumExtras.WaitHelpers.ExpectedConditions.StalenessOf(element)(d)));
     EstaticWait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(element)).Click();
 }