1

From the C# object model, it looks like this should do the trick, but the UseInPrivateBrowsing property has no effect at my end. Just opens a regular browser session in the edge.

var options = new EdgeOptions();
options.UseInPrivateBrowsing = true;
var driver = new EdgeDriver(options);

I am using the latest Selenium.WebDriver.MicrosoftDriver.

These are the installed packages:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="NUnit" version="3.10.1" targetFramework="net47" />
  <package id="NUnit3TestAdapter" version="3.10.0" targetFramework="net47" />
  <package id="Selenium.Chrome.WebDriver" version="2.40" targetFramework="net47" />
  <package id="Selenium.Support" version="3.13.0" targetFramework="net47" />
  <package id="Selenium.WebDriver" version="3.13.0" targetFramework="net47" />
  <package id="Selenium.WebDriver.MicrosoftDriver" version="17.17134.0" targetFramework="net47" />
</packages>

How is this supposed to be done?

2
  • Which language do you use? JavaScript?
    – Andrei
    Commented Jun 30, 2018 at 7:03
  • 1
    Using C# for this.
    – Oddleif
    Commented Jun 30, 2018 at 7:09

2 Answers 2

2

The UseInPrivateBrowsing property will only work for versions of the driver for Microsoft Edge that support the W3C WebDriver Specification. Unfortunately, these versions of the driver are only available in Windows Insider builds at the moment. Once a version of the driver is released to widely available versions of Windows 10, this property will work everywhere for Edge.

0

Until UseInPrivateBrowsing works, you could try replacing just that line with:

options.AddArgument("inprivate");

that allowed me to open up an "InPrivate" window using Selenium.WebDriver 4.0.0-beta4.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.