I am using Visual Studio 2022, and I have developed a program using WebDriver. When I test the program, there are no issues. However, when I create a setup file and install it on another computer, I encounter the following error. I am aware that the problem is related to 'chromedriver.exe,' and I have provided the exact location. Despite that, I continue to receive the error, even though both Chrome and the ChromeDriver are up-to-date.

screenshot of error message

private void OpenSelenium()
        {

            string startUpPath = AppDomain.CurrentDomain.BaseDirectory;
            string chromeDriverPath = @"C:\ChromeDriver\chromedriver.exe";

            ChromeDriverService service = ChromeDriverService.CreateDefaultService(chromeDriverPath);

            ChromeOptions options = new ChromeOptions();
            options.BinaryLocation = @"C:\Program Files\Google\Chrome\Application\chrome.exe";

            service.HideCommandPromptWindow = true; // console

            drv = new ChromeDriver(service, options);
            drv.Navigate().GoToUrl("https://www.gov.tr");

        }
0

There are 0 best solutions below