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));
}
Meine Fragen:Ist dies der beste Weg, um auf Selen WebElement zu warten?
Wie dies expectedConditions
statt, was zur Zeit in meiner Methode ist setzen?
Ich versuche zu ändern:
IWebElement element =
wait.Until<IWebElement>(ExpectedConditions.ElementIsVisible(by));
mit diesem:
IWebElement element =
wait.Until<IWebElement>(expectedConditions(by));
und erhielt diesen Fehler:
Method name expected.