0

I need help with launching Edge in InPrivate mode with Selenium and Java. I am not using Robot framework so cannot use the below solution: Open Edge in InPrivate mode using Selenium

Also I tried the other solutions suggested by this solution, it did not work: How to start Edge browser in Incognito mode using selenium remote webdriver?

So, not sure if there are any other solutions to it.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Tuhin Ganguly
  • 31
  • 1
  • 5

1 Answers1

2

A bit late to the party, but this answer helped me. Namely,

EdgeOptions options = new EdgeOptions();
options.AddAdditionalCapability("InPrivate", true);
this.edgeDriver = new EdgeDriver(options);

FYI, there's also a EdgeOptions property called UseInPrivateBrowsing(at least in C#). Setting this flag to true only works for Microsoft Edge browsers that support the "W3C WebDriver Specification", according to this post.

natn2323
  • 1,983
  • 1
  • 13
  • 30