Run chrome browser in inconginto Mode in Selenium

0 votes

I want to run chrome in incognito mode through selenium. I googled enough for it and found how to run chrome directly in incognito mode, and  found this:

  1. Right click on the shortcut of Google Chrome and select "Properties".
  2. On "Shortcut" tab on the "Target" field add an –incognito to the end of program path. So in the "Target" field you should have "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" –incognito

but I didn't get how to run this in selenium.

Jul 31, 2018 in Selenium by darklord
• 6,140 points
2,133 views

1 answer to this question.

0 votes

One other way to launch Chrome in incognito mode is add argument -incognito like following

ChromeOptions options = new ChromeOptions();
options.addArguments("--incognito");
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
answered Jul 31, 2018 by Meci Matt
• 9,400 points
It Worked for me!
It's not working for me.I am using Intellije ,windows10

Can you share what's the error you are facing? 

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
0 votes
1 answer

Selenium ChromeDriver issue - Want to run it in background, but not as headless browser

This is a flaw with ChromeDriver. Tried ...READ MORE

answered Mar 26, 2018 in Selenium by nsv999
• 5,050 points
769 views
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,050 points
180 views
0 votes
1 answer

Selenium grid 2 in chrome browser

The problem is in -Dwebdriver arguments. Maybe you should do ...READ MORE

answered Apr 27, 2018 in Selenium by Samarpit
• 5,130 points
205 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,050 points
261 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
629 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
257 views
0 votes
5 answers
0 votes
1 answer

Opening Browser in Selenium

Here is the code to open the ...READ MORE

answered Apr 20, 2018 in Selenium by Meci Matt
• 9,400 points
20 views