728x90
1. [NuGet 패키지 관리]에서 [DotNetSeleniumExtras.WaitHelpers] 설치
2. 아래 소스 추가!
- css 요소가 화면에 보일때까지 대기.
// 화면에 요소가 보일 때까지 대기
private static bool ElementWait(IWebDriver driver, By by)
{
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;
}
public void WaitData()
{
// [ElementWait] 사용하기
ElementWait(driver, By.CssSelector(".se-image-resource"));
}
728x90
반응형
'소프트웨어 개발 > 비주얼스튜디오(Visual Studio)' 카테고리의 다른 글
[VB] 빌드 시 Error occurred during proessing of input file / Unable to find tool "ildasm.exe" error 해결 (0) | 2022.09.08 |
---|---|
[c#] 비주얼스튜디오(Visual Studio) 탭(들여쓰기) 옵션 조절 (0) | 2022.07.13 |
[C#/Devexpress/Winform] GridControl(GridView) 사용하기 - 1 (0) | 2022.06.20 |
[C#] Devexpress GridContorl(GridView) 가운데 정렬 방법 (0) | 2022.06.20 |
[C#] Microsoft Excel 참조 찾는 방법 (0) | 2022.06.08 |
댓글