How to open chrome driver in incognito mode?

0 votes
How can I open chrome driver in Incognito mode so that the history is not saved and no cache data is generated?

Can someone help me?
Dec 28, 2018 in Selenium by Sradha
• 1,750 points
1,815 views

1 answer to this question.

0 votes

Hey @Sradha,

You can use the below code:-

System.setProperty("webdriver.chrome.driver","C:\\Users\\Nabarupa_Das\\Downloads\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("--incognito");
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver=new ChromeDriver(capabilities);

Hope this helps.

answered Dec 28, 2018 by Nabarupa
This is not working on latest version of chrome!!! whats the way out? any help please

Also you can try using something like this: 

  1. Check if Allow in incognito is switched On for JetBrains IDE Support extension (chrome://extensions/)
  2. open WebStorm preferences -> Tools -> Web browsers -> Chrome -> Edit -> Command line options: -incognito

Related Questions In Selenium

0 votes
1 answer

How to start headless chrome in incognito mode?

You are missing a single -... "--incognito" READ MORE

answered Aug 13, 2018 in Selenium by Samarpit
• 5,890 points
909 views
0 votes
1 answer

How to open Firefox window in Incognito mode using Selenium Webdriver?

Hi Pritha, you can use this code ...READ MORE

answered May 14, 2019 in Selenium by Anvi
• 14,110 points
2,518 views
0 votes
1 answer

Chrome selenium driver - how to detach / leave the browser open after the get test is completed?

Hey Stephan, I had the similar issue ...READ MORE

answered Nov 4, 2019 in Selenium by Abha
• 27,930 points
2,022 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,520 points
3,768 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31 in Selenium by Sri
• 2,970 points
4,747 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
2,729 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2 in Selenium by Sri
• 2,970 points
3,089 views
0 votes
7 answers

How to open a link in new tab of chrome browser using Selenium WebDriver?

Try this once driver.findElement(By.id("id")).sendKeys(Keys.CONT ...READ MORE

answered Sep 5 in Selenium by Sri
• 2,970 points
48,824 views
+1 vote
1 answer

How to handle notifications in Python with Selenium (Chrome WebDriver)

Below will help you: You can disable the ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
6,670 views