opening private mode in firefox through selenium

北慕城南 提交于 2019-12-13 12:39:49

问题


Actually i want to open a incognito/private mode of firefox browser through selenium , but everytime i tried it was opening firefox in normal mode.

After some googling I got this code,which i used to open private mode in firefox through selenium but it is not working.

    FirefoxProfile firefoxProfile = new FirefoxProfile();

    firefoxProfile.setPreference("browser.privatebrowsing.autostart", true);
    WebDriver driver = new FirefoxDriver(firefoxProfile);

    driver.get("http://www.google.com");

can someone help how to do this?

来源:https://stackoverflow.com/questions/40420094/opening-private-mode-in-firefox-through-selenium

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