// todo: unit/integration test this public IWebElement ActionOnLocator(Locators.By.jQueryBy jQueryFindExpression, Action <IWebElement> action, TimeSpan maxWait = default(TimeSpan)) { var element = _finder.Element(jQueryFindExpression, maxWait); action(element); return(element); }
public static IWebElement PerformActionOn(this IWebDriver browser, Locators.By.jQueryBy by, Action <IWebElement> actionToPerform) { var element = browser.FindElementByjQuery(@by); actionToPerform(element); return(element); }
public IWebElement OptionalElement(Locators.By.jQueryBy jQueryFindExpression, TimeSpan maxWait = default(TimeSpan)) { try { return(Element(jQueryFindExpression, maxWait)); } catch (NoSuchElementException) { return(null); } }
public IEnumerable <IWebElement> Elements(Locators.By.jQueryBy jQueryFindExpression, TimeSpan maxWait = new TimeSpan()) { var atLeastOneElement = OptionalElement(jQueryFindExpression, maxWait); if (atLeastOneElement == null) { return(Enumerable.Empty <IWebElement>()); } return(Browser.FindElements(jQueryFindExpression)); }
// todo: unit/integration test this public IWebElement ActionOnLocator(Locators.By.jQueryBy jQueryFindExpression, Action <IWebElement> action, TimeSpan maxWait = default(TimeSpan)) { try { var element = _finder.Element(jQueryFindExpression, maxWait); action(element); return(element); } catch (Exception) { _camera.TakeScreenshot(); throw; } }
public IWebElement TryFindElementByjQuery(Locators.By.jQueryBy @by) { throw new NotImplementedException("Obsolete"); }
public IWebElement Element(Locators.By.jQueryBy jQueryFindExpression, TimeSpan maxWait = default(TimeSpan)) { return(Browser.ElementWithWait(d => d.FindElementByjQuery(jQueryFindExpression), maxWait)); }