Skip to content

Instantly share code, notes, and snippets.

@kypflug
Last active November 16, 2019 04:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kypflug/da38b9e15382ddf6825f25feb975b6c0 to your computer and use it in GitHub Desktop.
Save kypflug/da38b9e15382ddf6825f25feb975b6c0 to your computer and use it in GitHub Desktop.
Running WebDriver against Edge (Chromium)
static void Main(string[] args)
{
// EdgeOptions() requires using OpenQA.Selenium.Edge
// Construct EdgeOptions with is_legacy = false
var edgeOptions = new EdgeOptions(false);
edgeOptions.BinaryLocation = "{FULL_PATH_TO_MSEDGE.EXE}\\msedge.exe";
var msedgedriverDir = "{FULL_PATH_TO_MSEDGEDRIVER.EXE}";
var msedgedriverExe = "msedgedriver.exe";
// Construct EdgeDriverService with is_legacy = false too
var service = EdgeDriverService.CreateDefaultService(msedgedriverDir, msedgedriverExe, false);
service.EnableVerboseLogging = true;
var driver = new EdgeDriver(service, edgeOptions);
driver.Url = "http://www.example.com";
}
@crushonme
Copy link

Which version of Selenium.WebDriver are you using? Latest is 3.14.0 and there is no EdgeOptions constructer that takes 1 argument.

@marvhen
Copy link

marvhen commented Nov 16, 2019

Hi @crushonme I had the same question and dug into the Selenium source code to find out. The EdgeOptions constructor with 1 argument was added in the Add support for the new Microsoft Edge commit on May 24, 2019. The problem with this of course is is hasn't been officially released yet so either you will have to build the project yourself or look around for a pre-release build such as the ones mentioned here and here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment