One other way to launch chrome in incognito mode is to add argument “-incognito” like following:
ChromeOptions options = new ChromeOptions();
options.addArguments("--incognito");
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
This solution works for me.
More Related Contents:
- Syntax error on token “else”, delete this token [closed]
- Selenium – Basic Authentication via url
- Page scroll up or down in Selenium WebDriver (Selenium 2) using java
- java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property
- Error Loading Extension Could not load extension from ‘C:\..\Local\Temp\scoped_dir6312_32763\internal’. Loading of unpacked extensions is disabled
- org.openqa.selenium.WebDriverException: unknown error: call function result missing ‘value’
- java.lang.IllegalStateException: The driver executable does not exist: while trying to execute tests through Selenium, ChromeDriver and Chrome
- Could not load extension from scoped_dir6312_32763/internal.Loading of unpacked extensions is disabled by the administrator with ChromeDriver Selenium
- Chrome 59 and Basic Authentication with Selenium/Fluentlenium
- How to handle authentication popup in Chrome with Selenium WebDriver using Java
- Way to open Selenium browser not overlapping my current browser
- How to open a link in new tab (chrome) using Selenium WebDriver?
- Disable Chrome notifications (Selenium)
- Chrome is being controlled by automated test software
- Set Chrome’s language using Selenium ChromeDriver
- Is it possible to switch to an element in a frame without using driver.switchTo().frame(“frameName”) in Selenium Webdriver Java?
- Exception in thread “main” org.openqa.selenium.NoSuchElementException: Unable to locate element: //*[@id=’login-email’]
- Find element by attribute
- Selenium wait for Ajax content to load – universal approach
- Tools for measuring UI Performance [closed]
- How to solve java.lang.NoClassDefFoundError? Selenium
- getText() method of selenium chrome driver sometimes returns an empty string
- Set capability on already running selenium webdriver
- Getting StaleElementReferenceException while trying print the link names
- org.openqa.selenium.ElementClickInterceptedException: element click intercepted error using Selenium and Java in headless mode
- How to upload a file in Selenium with no text box
- java.lang.OutOfMemoryError: unable to create new native thread error using ChromeDriver and Chrome through Selenium in Spring boot
- How to select the Date Picker In Selenium WebDriver
- Selenium get .har file
- Is there a way to search webelement on a main window first, if not found, then start searching inside iframes?