0

My OS Build: 16299.309 so I download MS WebDriver, ver. 5.16299 release: 16299, from https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

My SetEdgeDriver() method in C#:

private IWebDriver SetEdgeDriver()
    {
        try
        {
            var path = @"C:\FolderWhereMSWebDriverExeFile ";
            var option = new EdgeOptions();

            option.PageLoadStrategy = PageLoadStrategy.Normal;                
            return new EdgeDriver(path, option);
        }
        catch (Exception)
        {                
            throw;
        }
    }

When the unit test is executed, Edge browser opens briefly then it closes with an error saying "Unexpected error. Unknown error"
The test is just about going to Google search site and works fine with Chrome.
I have followed this: Edge browser crashing after initial watir-webdriver launch but no luck. Please advice.

ElasticCode
  • 7,311
  • 2
  • 34
  • 45
T.Doan
  • 1
  • 1

1 Answers1

0

You can try a different constructor:

IWebDriver wrappedWebDriver = new EdgeDriver(new EdgeOptions());

This works for me. No need to specify the folder. Also, think that the normal search patter is the default one.

Anton Angelov
  • 1,705
  • 13
  • 16