public bool IsElementVisible(GrabByType grabbytype, string grabberstring, int allowedWaitTimeInSeconds = 1) { try { GrabBy grabber = GrabBy.Create(grabbytype, grabberstring); By by = grabber.GetBy(); System.TimeSpan timeToWait = new TimeSpan(0, 0, allowedWaitTimeInSeconds); WebDriverWait wait = new WebDriverWait(CTest.Driver, timeToWait); IWebElement clickableElementOnPage = wait.Until(ExpectedConditions.ElementToBeClickable(by)); return(true); } catch (Exception) { return(false); } }
public void Change(GrabByType type, string selectorstring) { GrabByType = type; selector = selectorstring; }
public GrabBy(GrabByType type, string selectorstring) { GrabByType = type; selector = selectorstring; }
public static GrabBy Create(GrabByType type, string selectorstring) { return(new GrabBy(type, selectorstring)); }
public void SetOnPageLoadWaitForVisibilityOfThisElement(GrabByType bytype, string elementgrabberstring) { GrabBy by = GrabBy.Create(bytype, elementgrabberstring); OnPageLoadWaitForVisibilityOfThisElement = by; }
public IWebElement FindClickableElement(IWebElement element, GrabByType type, string elementgrabber, int allowedWaitTimeInSeconds = DefaultWaitTime) { GrabBy by = GrabBy.Create(type, elementgrabber); return(GenericFindClickableElement(element, by, allowedWaitTimeInSeconds)); }