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,720 points
217 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

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,130 points
415 views
0 votes
1 answer
0 votes
2 answers

Can anyone help me that how to run Selenium WebDriver test cases in Chrome?

You first need to download chrome driver ...READ MORE

answered Aug 26 in Selenium by Abha
• 23,030 points
251 views
0 votes
1 answer

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,090 points
589 views
0 votes
1 answer
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,130 points
898 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
575 views
0 votes
5 answers
0 votes
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,130 points
2,290 views