OpenQA.Selenium.DriverServiceNotFoundException

159 views
Skip to first unread message

rachida benchlih

unread,
Mar 29, 2022, 2:35:29 AM3/29/22
to Selenium Users
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();
        }
    }
}

alphs alivio

unread,
Mar 29, 2022, 3:26:32 AM3/29/22
to seleniu...@googlegroups.com
Try to Use escape character for the directory or location of your driver since you are in windows.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/5f1e6e33-c0b0-4e37-87d6-923ee4376a59n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages