'Cannot start firefox browser instance for tests using Visual Studio, C#, Nunit and Selenium
I am having troubles trying to run simple UI test in Visual Studio (16.11.10) using C# and NUnit. I am using Selenium.Firefox.WebDriver version 0.27.0., Selenium.WebDriver and Selenium.Support both 4.1.0
Test:
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
namespace ClassLibrary2
{
public class Class1
{
[Test]
public static void TestBrowser()
{
IWebDriver driver = new FirefoxDriver();
driver.Url = "https://login.yahoo.com/";
driver.Quit();
}
}
}
Running this test I am getting such error:
TestBrowser
Source: Class1.cs line 10
Duration: 4,6 sec
Message:
OpenQA.Selenium.WebDriverException : Cannot start the driver service on http://localhost:59898/
Stack Trace:
DriverService.Start()
DriverServiceCommandExecutor.Execute(Command commandToExecute)
WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
WebDriver.StartSession(ICapabilities desiredCapabilities)
WebDriver.ctor(ICommandExecutor executor, ICapabilities capabilities)
FirefoxDriver.ctor(FirefoxDriverService service, FirefoxOptions options, TimeSpan commandTimeout)
FirefoxDriver.ctor(FirefoxOptions options)
FirefoxDriver.ctor()
Class1.TestBrowser() line 18
Standard Output:
Unable to connect to the remote server
All works fine using ChromeDriver. Thanks for your help.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
