다음과 같이 특정 요소가 나타날 때까지 기다리는 함수를 만들 수 있습니다.
private static bool WaitForVisivle(IWebDriver driver, By by)
{
// 5초 동안 기다립니다.
WebDriverWait wait = new WebDriverWait(driver, Tim..
다음과 같이 특정 요소가 나타날 때까지 기다리는 함수를 만들 수 있습니다.
private static bool WaitForVisivle(IWebDriver driver, By by)
{
// 5초 동안 기다립니다.
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5));
try
{
IWebElement element = wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(by));
}
catch (Exception e) {
return false;
}
return true;
}
아래와 같이 위 함수를 호출하여 사용합니다.
WaitForVisivle(driver, By.CssSelector(".field-input"));
댓글