1. 경고창 예외 처리
This commit is contained in:
@@ -393,6 +393,20 @@ namespace SmartSearch
|
|||||||
{
|
{
|
||||||
// 페이지 이동 후 대기 및 끝 탭 설정
|
// 페이지 이동 후 대기 및 끝 탭 설정
|
||||||
_IWebDriver.SwitchTo().Window(_IWebDriver.WindowHandles.Last());
|
_IWebDriver.SwitchTo().Window(_IWebDriver.WindowHandles.Last());
|
||||||
|
|
||||||
|
WebDriverWait _WebDriverWait = new WebDriverWait(_IWebDriver, TimeSpan.FromSeconds(5));
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_WebDriverWait.Until(ExpectedConditions.AlertIsPresent());
|
||||||
|
_IWebDriver.SwitchTo().Alert().Accept();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Trace.WriteLine("=== 경고창 검사 ===");
|
||||||
|
Trace.WriteLine(ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
((IJavaScriptExecutor)_IWebDriver).ExecuteScript("window.scrollBy(0, document.body.scrollHeight);");
|
((IJavaScriptExecutor)_IWebDriver).ExecuteScript("window.scrollBy(0, document.body.scrollHeight);");
|
||||||
Thread.Sleep(m_Random.Next((int)optSearchWaitMin, (int)optSearchWaitMax));
|
Thread.Sleep(m_Random.Next((int)optSearchWaitMin, (int)optSearchWaitMax));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user