I have created a Console App (.NET Framework) project in my Visual Studio, added all the required packages (NUnit, Test3Adapter, Selenium) and gave the local path of my chrome.exe, and the test is running.
But, if I create an NUnit Test project (.NET Core), add all Nuget packages required and try to run my tests, I get the error stating that:
OpenQA.Selenium.WebDriverException : Cannot start the driver service on http://localhost:/
For running my script through Azure DevOps, it's advised to use NUnit project rather than having it as Console application.
Note:
I tried adding the chrome.exe path after manually downloading it and also tried adding chrome through Nuget Packets (Both Selenium.Chrome.WebDriver or Selenium.Webdriver.ChromeDriver). Nothing worked.
Irrespective of running in GUI or headless mode, I get the same error
Sample code:
IWebDriver driver;
[SetUp]
public void startBrowser()
{
driver = new ChromeDriver(Environment.CurrentDirectory);
}
[Test]
public void test()
{
}
[TearDown]
public void closeBrowser()
{
driver.Close();
}
Specifications:
Selenium.WebDriver (3.141.0)
Visual Studio 2017
NUnit (3.12.0)
NUnit3TestAdapter (3.13.0)