2013-03-18 60 views
0

我有一個自定義的下拉菜單,我需要點擊其中的一個選項。點擊後 - 顯示警報。所以,我建立一個鏈在IE中動作鏈後處理警報,webdriver

InvokeChain(() => Actions.MoveToElement(button).MoveToElement(targetOption).Click(targetOption)); 

protected static void InvokeChain(Func<Actions> chain) 
     { 
      chain.Invoke().Build().Perform(); 
     } 

在鉻它工作正常,但是當涉及到IE瀏覽器 - 驅動器無法處理退出鏈。我想,這是因爲警覺而發生的。鏈式線上的錯誤消息:

向遠程WebDriver服務器發送HTTP請求,URL爲 http:// .....點擊60秒後超時。

問題是我怎麼能從鏈中釋放驅動程序來處理警報?

回答

4

設置EnableNativeEvents =真


InternetExplorerOptions internetExplorerOptions = new InternetExplorerOptions 
{ 
    EnableNativeEvents = true 
}; 
IWebDriver driver = new InternetExplorerDriver(internetExplorerOptions); 
相關問題