Module 9 part 2 of C Selenium | Selenium C# Forum
J
John Posted on 31/10/2018
Hi My code is failing to run and this is the code:
public static void Main(string[] args)
{
DesiredCapabilities cap = new DesiredCapabilities(); //creating the object of the DC class
cap.SetCapability(CapabilityType.BrowserName, "firefox");
cap.IsJavaScriptEnabled = true;
cap.SetCapability(CapabilityType.Platform, "WINDOWS");
cap.SetCapability(CapabilityType.AcceptInsecureCertificates, true);

FirefoxDriverService service = FirefoxDriverService.CreateDefaultService("C:\\Users\\John Sodipo\\Downloads\\geckodriver-v0.16.1-win64", "geckodriver.exe");
FirefoxOptions options = new FirefoxOptions();
options.BrowserExecutableLocation = "@C:\\Program Files (x86)\\Mozilla Firefox\firefox.exe";
FirefoxDriver fd = new FirefoxDriver(service, options, TimeSpan.FromSeconds(20));
}

I am getting an exception Unhandled error: OpenQA.Selenium.WebDriverException: 'Unable to find a matching set of capabilities'

FROM MODULE 9 Part 2 lecture. I am trying to run a DesiredCapabilities object.  19mins of the lesson

S
Support Desk Replied on 29/05/2019

You can make use of Firefox options only.