Search code examples
c#seleniumsafaridriver

Is there any way to use the legacy protocol for Safari using Selenium C#


Host machine: Windows 10 with VS 2017, Selenium (.NET) & SpecFlow+

I've got a Mojave MacOS with Safari v12 on the network that I need to run my test scripts on. I'm running Selenium C# scripts on it using RemoteWebDriver but they are failing because v12 uses the latest W3C protocols. SafariDriver can be started using the "--legacy" switch. SafariDriverService has a "UseLegacyProtocol" but can't be passed in RemoteWebDriver (example below). Is there a way to activate the switch by: a) Passing it through RemoteWebDriver? b) Merging it as a capability with the options and passing it through RemoteWebDriver? c) Configuring the switch in a json file for use with Selenium Grid v3?

This is to work with C# code.

Code examples I already have:

var sOptions = new SafariOptions();
sOptions.Proxy = null;
var sService = SafariDriverService.CreateDefaultService();
sService.Port = xxxx;
sService.UseLegacyProtocol = true;
Browser = new SafariDriver(sService, sOptions,
TimeSpan.FromSeconds(PageTimeout));

var rOptions = new SafariOptions();    
Browser = new RemoteWebDriver(new Uri("http://xx.xxx.xx.xx:xxxx/wd/hub"), rOptions);

Thanks


Solution

  • Legacy protocol is no longer supported in shipping versions of Safari/safaridriver, so I think this question can be closed.