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,710 points
97 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
314 views
0 votes
1 answer
0 votes
1 answer

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

Download the executable driver from: ChromeDriver Download Before ...READ MORE

answered Mar 29, 2018 in Selenium by nsv999
• 5,030 points
120 views
0 votes
1 answer

How to Create Object Repository in Selenium Web Driver?

Try POM Model (Page object model). Refer ...READ MORE

answered Apr 17, 2018 in Selenium by adam
358 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,030 points
61 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
432 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
49 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
1,372 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.