0

OS Build Number:- 18363.900 Edge Version: 83.0.478.54 MicrosoftWebDriver Version: 83.0.478.54

Here is the code:

  System.Environment.SetEnvironmentVariable("webdriver.edge.driver", "E:\\edgedriver_win64\\msedgedriver.exe");
  IWebDriver driver = new EdgeDriver();

I am getting error as: OpenQA.Selenium.WebDriverException: 'Unexpected error. Unknown error'

1 Answer 1

1

Which version of Selenium WebDriver are you using? I suggest you to use the latest version 4.0.0-alpha05 and use the code below:

EdgeOptions edgeOptions = new EdgeOptions();
edgeOptions.UseChromium = true;
edgeOptions.BinaryLocation = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe";
var msedgedriverDir = @"D:\webdriver83.0.478.54";
var driver = new EdgeDriver(msedgedriverDir, edgeOptions);
driver.Navigate().GoToUrl("https://bing.com");
Thread.Sleep(3000);
driver.Close(); 

Note: Change the paths in the code to your owns.

Result:

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for your suggestion. I am using selenium 3.141.0 in NuGet Package Manager. I am not able to find the version "4.0.0-alpha05" NuGet Package Manager. Could you share the steps to get the latest version
You could run Install-Package Selenium.WebDriver -Version 4.0.0-alpha05 in Package Manager Console to install it: i.sstatic.net/erupP.png. To open the Package Manager Console window, you could click View-> Other Windows-> Package Manager Console.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.