I am using Selenium 3.4 to launch Edge using the Microsoft WebDriver which is now maintained by Microsoft.
Is there any way I can launch the Browser in InPrivate mode using Selenium?
I have searched for answers but couldn't find any.
The closest I got was How to start Edge browser in Incognito mode using selenium remote webdriver?
The solution mentioned there doesn't work. It just shows the same tab as would be shown in InPrivate, but the window isn't a private one. As such, the information is stored and the session is not private.
Use the below code, employing java.awt.Robot to simulate the key combination
CTRL+SHIFT+P
to open a new browser window in InPrivate mode:Note that we are using robot class and so if the system locks it may not work.