How to start Edge browser in Incognito mode using selenium remote webdriver?

≯℡__Kan透↙ 提交于 2019-12-02 03:06:32

问题


Currently we are working on selenium (2.53.0) with Edge browser using C#. Edge browser stores cache information at 'localAppdata' folder because of cache, we are facing some issues while test cases execution.

I try to delete all cookies information using selenium (DeleteAllCookies) but it not working for Edge browser.

I read couple of Microsoft forums only way to skip cache, when we start Edge browser on incognito mode.

Can any one suggest how to start Edge browser instance in private (incognito mode) using selenium remote-webdriver


回答1:


if you want to open Edge in Private (Incognito) mode, you can use this C# code:

EdgeOptions options = new EdgeOptions();
options.AddAdditionalCapability("InPrivate", true);
this.edgeDriver = new EdgeDriver(options);


来源:https://stackoverflow.com/questions/36547933/how-to-start-edge-browser-in-incognito-mode-using-selenium-remote-webdriver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!