I want to run chrome in incongito mode through selenium.
I googled enough for it and found how to run chrome directly in incongito mode with the h
According to the ChromeDriver wiki you can pass parameters to the executable like this:
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability("chrome.switches", Arrays.asList("--incognito"));
WebDriver driver = new ChromeDriver(capabilities);
So passing the paremeter --incognito should do the trick.