S.O.: Windows 10.
Opera: 105.0.4970.34
Opera driver: 119.0.6045.124
Selenium: 4.16.2
C# code:
Opera run with:
... ...
proc = new Process();
proc.StartInfo.FileName = BinaryLocationOpera; //String with path to opera.exe
proc.StartInfo.Arguments = "--remote-debugging-port=6526 --user-data-dir=\"c:\\selenum\\OperaProfile\"";
proc.StartInfo.CreateNoWindow = true;
proc.Start();
Create driver:
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.DevTools.V119.Page;
using Network = OpenQA.Selenium.DevTools.V119.Network;
using DevToolsSessionDomains = OpenQA.Selenium.DevTools.V119.DevToolsSessionDomains;
... ...
var options = new ChromeOptions
{
BinaryLocation = BinaryLocationOpera, //String with path to opera.exe
DebuggerAddress = DebuggerAddressChrome, //String with 127.0.0.1:6526
};
var service = ChromeDriverService.CreateDefaultService(PathSelenium, "operadriver.exe");
service.Start();
IWebDriver opera = new ChromeDriver(service, options);
IDevTools devTools = opera as IDevTools;
//Error
DevToolsSession session = devTools.GetDevToolsSession(119);
... ...
ERROR:
OpenQA.Selenium.WebDriverException
HResult=0x80131500
Message=Cannot find goog:chromeOptions capability for driver
Source=WebDriver
StackTrace:
at OpenQA.Selenium.Chromium.ChromiumDriver.GetDevToolsSession(Int32 devToolsProtocolVersion) ... ...
¿How to use DevTools with OperaDriver?
Thank you.
Environment:
S.O.: Windows 10. Opera: 105.0.4970.34 Opera driver: 119.0.6045.124 Selenium: 4.16.2
C# code:
Opera run with:
Create driver: