Hello everybody, hope you're well.
When I using selenium 4 with EdgeDriver in c#, I've this message error.
I'll tried to resolve it but without result, can you help me urgently, please i need to find a solution today for my project.
#Same issue with, ChromeDriver.
Thank you advanced.
---------------------------------------------------------------------------------------
Message:
Initialization method RmpTest1.EdgeDriverTest.EdgeDriverInitialize threw exception. OpenQA.Selenium.DriverServiceNotFoundException: The file C:/Users/AdminRBE/Desktop/Edge/edgedriver_win64 (1)/msedgedriver.exe\MicrosoftWebDriver.exe does not exist. The driver can be downloaded at
http://go.microsoft.com/fwlink/?LinkId=619687.
TestCleanup method RmpTest1.EdgeDriverTest.EdgeDriverCleanup threw exception. System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object..
------------------------------------------------------------------------------------------------
Stack Trace:
DriverService.ctor(String servicePath, Int32 port, String driverServiceExecutableName, Uri driverServiceDownloadUrl)
EdgeDriver.ctor(String edgeDriverDirectory, EdgeOptions options)
EdgeDriver.ctor(String edgeDriverDirectory)
EdgeDriverTest.EdgeDriverInitialize() line 25
TestCleanup Stack Trace
EdgeDriverTest.EdgeDriverCleanup() line 39
-----------------------------------------------------------------
Code:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Edge;
using
OpenQA.Selenium.IE;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;
namespace RmpTest1
{
[TestClass]
public class EdgeDriverTest
{
// In order to run the below test(s),
// please follow the instructions from
http://go.microsoft.com/fwlink/?LinkId=619687 // to install Microsoft WebDriver.
public EdgeDriver _driver;
[TestInitialize]
public void EdgeDriverInitialize()
{
// Initialize edge driver
new DriverManager().SetUpDriver(new EdgeConfig());
IWebDriver driver = new EdgeDriver(@"C:/Users/AdminRBE/Desktop/Edge/edgedriver_win64 (1)/msedgedriver.exe");
}
[TestMethod]
public void VerifyPageTitle()
{
// Replace with your own test logic
_driver.Url = "
https://www.google.com/";
// Assert.AreEqual("React App", _driver.Title);
}
[TestCleanup]
public void EdgeDriverCleanup()
{
_driver.Quit();
}
}
}