I'm trying to run some unit tests using Selenium Webdriver and C#.Net for Firefox browser but I was unable to do it (Chrome and IE11 browsers are working smoothly).
Here is the info I gathered:
OS: Windows 10 Enterprise
Gecko driver version: geckodriver-v0.17.0-win32
Mozilla Firefox version: 54.0.1 (32-bit)
Environment Path variable already set under "C:\LEO\SELENIUM C#\Firefox"
Piece of Code:
using System;
using System.Text;
using System.Threading;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium.Firefox;
[TestFixture]
public class UnitTest3
{
private IWebDriver driver;
private StringBuilder verificationErrors;
private string baseURL;
[SetUp]
public void SetupTest()
{
FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@"C:\LEO\SELENIUM C#\Firefox");
service.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";
driver = new FirefoxDriver(service);
baseURL = "http://www.dow.com";
verificationErrors = new StringBuilder();
}
}
Error:
Message: OpenQA.Selenium.WebDriverException : Unable to find a matching set of capabilities.
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
StackTrace: