вівторок, 7 березня 2017 р.

How to open Chrome/Firefox/Internet Explorer/Opera in private/incognito window in Selenium WebDriver

Chrome: DesiredCapabilities capabilities = DesiredCapabilities.chrome(); ChromeOptions options = new ChromeOptions(); options.addArguments("incognito"); capabilities.setCapability(ChromeOptions.CAPABILITY, options); FireFox: FirefoxProfile firefoxProfile = new FirefoxProfile(); firefoxProfile.setPreference("browser.privatebrowsing.autostart", true); Internet Explorer: DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer(); capabilities.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS,...
Continue Reading...

Blogger templates

Blogroll

About