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,760 points
5,348 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,910 points
3,149 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,150 points
7,126 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,140 points
5,971 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,500 points
13,764 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,190 points
9,184 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,910 points
7,258 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 3, 2020 in Selenium by Sri
• 3,190 points
7,896 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 14, 2020 in Selenium by Gitika
• 65,770 points
103,120 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,910 points
14,471 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP