I want to test my test cases in private window or incognito window.
How to do the same in various browsers:
How to avoid Extensions in Private Mode prompt
For the actual geckodriver version I use:
options.addArguments("-private");
It works fine but the annoying notification appears: Extensions in Private Mode.
I found the way to avoid it:
options.addPreference("extensions.allowPrivateBrowsingByDefault",true);
As a result all extensions will run in private browsing mode without prompting at start