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