1

IE9 (win7、c#、selenium 2.3) の webdriver に問題があります。NoSuchWindowException例外が発生します。すべてのセキュリティ レベルの「保護モードを有効にする」を同じ値に変更する必要があることがわかりました。しかし、テストのためにプログラムで設定を変更したくありません。IntroduceInstabilityByIgnoringProtectedModeSettingsに設定するだけでうまくいくと思いましたtrueが、そうではありません。私のコード(これらの行は正常に動作します):

var option = new InternetExplorerOptions();
option.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
IWebDriver Driver = new InternetExplorerDriver(option);

Driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));
Driver.Navigate().GoToUrl(baseUrl);

これにより例外が発生します:

Driver.Manage().Window.Maximize();

An exception of type 'OpenQA.Selenium.NoSuchWindowException' occurred in WebDriver.dll but was not handled in user code
Additional information: Error retrieving window with handle current

これも:

string pageSource = Driver.PageSource;

An exception of type 'OpenQA.Selenium.NoSuchWindowException' occurred in WebDriver.dll but was not handled in user code
Additional information: Unable to get browse

何がうまくいかないのか/テストを実行するために何ができるのか分かりますか?

4

0 に答える 0