Unable to open Edge in InPrivate mode using selenium web driver

时间秒杀一切 提交于 2020-01-24 21:29:04

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/51112482/unable-to-open-edge-in-inprivate-mode-using-selenium-web-driver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!