public static void ConditionIsTrue(Func <bool> condition, string conditionDescription = "Condition", int timeoutSec = 15) { void IsResultTrue() { if (!condition()) { throw new Exception(); } } TryCatchMethods.TryCatchVoid(IsResultTrue, timeoutSec, $"{conditionDescription} was not true after timeout."); }
public static void ClickOnElement(this IWebElement element, int timeOutSec = DefaultTimeOutSec) => TryCatchMethods.TryCatchVoid(element.Click, timeOutSec);
public static IWebElement GetElementBy(this ISearchContext rootElement, By locator, int timeOutSec = DefaultTimeOutSec) => TryCatchMethods.TryCatchReturn(() => rootElement?.FindElement(locator), timeOutSec);