public static StubbornWebElement ClickToOpenFirstOf(this StubbornWebElement element, params By[] expectedPopupElements) { element.Click(webElement => expectedPopupElements.Any(selector => IsDisplayedSafe(() => webElement().Driver().FindElement(selector)))); var displayedPopupElement = expectedPopupElements.First(selector => IsDisplayedSafe(() => GetDriver(element).FindElement(selector))); return(new StubbornWebElement(displayedPopupElement, element)); }
public static void ClickToClose(this StubbornWebElement element, By expectedMissingElement = null) { if (expectedMissingElement == null) { expectedMissingElement = element.Selector; } element.Click(_ => ExpectedConditions.InvisibilityOfElementLocated(expectedMissingElement)); }
public static StubbornWebElement ClickToOpen(this StubbornWebElement element, By expectedPopupElement, Func <IWebElement, bool> predicate = null, WaitTime waitTime = WaitTime.Short) { element.Click(webElement => ElementIsVisible(webElement().Driver(), expectedPopupElement, predicate), waitTime: waitTime); return(new StubbornWebElement(expectedPopupElement, element)); }