0
我試圖在使用Selenium C#運行我的自動化測試時,在InPrivate模式下啓動IE11。找到了這樣做的選項,但我似乎無法使用這些代碼行使我的工作。Selenium C#InPrivate模式Internet Explorer
InternetExplorerOptions options = new InternetExplorerOptions();
options.ForceCreateProcessApi = true;
options.BrowserCommandLineArguments = "-private";
IWebDriver driver = new InternetExplorerDriver(options);
return driver;
驅動程序打開,因爲我可以在任務管理器上看到它,但IE瀏覽器無法打開。如果我通過InternetExplorerDriver刪除選項,它可以正常工作。所以選項有問題。你有什麼想法嗎?
謝謝!
我在這裏無法理解「如果我通過InternetExplorerDriver刪除選項,它可以正常工作。」你想要刪除什麼? –
我的意思是如果我只是做 新的InternetExplorerDriver(); 而不是 新InternetExplorerDriver(選項); 選項部分導致斷開,但無法找到問題,因爲它似乎只是聲音。 – cmarquez
你的代碼是否會引發任何錯誤? –