public static IWebElement FindElement(ExpectedConditions expectedConditions, By by, int timeoutInSeconds)
{
DefaultWait<IWebDriver> wait = new DefaultWait<IWebDriver>(driver);
wait.Timeout = TimeSpan.FromSeconds(timeoutInSeconds);
wait.PollingInterval = TimeSpan.FromMilliseconds(10000);
wait.IgnoreExceptionTypes(typeof(NoSuchElementException));
IWebElement element =
wait.Until<IWebElement>(ExpectedConditions.ElementIsVisible(by));
}
Мои вопросы:Разве это лучший способ подождать селена WebElement?
Как поставить этот expectedConditions
вместо того, что в настоящее время в моем методе?
я пытаюсь изменить:
IWebElement element =
wait.Until<IWebElement>(ExpectedConditions.ElementIsVisible(by));
с этим:
IWebElement element =
wait.Until<IWebElement>(expectedConditions(by));
И получил эту ошибку:
Method name expected.