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
2,477 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
1,120 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,130 points
3,273 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
• 28,000 points
2,847 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
4,661 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

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

answered Aug 31, 2020 in Selenium by Sri
• 3,010 points
5,492 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
3,322 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, 2020 in Selenium by Sri
• 3,010 points
3,933 views
0 votes
8 answers

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

This below code works for me in ...READ MORE

answered Dec 13, 2020 in Selenium by Gitika
• 65,870 points
61,266 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
8,137 views