-
-
Save kypflug/da38b9e15382ddf6825f25feb975b6c0 to your computer and use it in GitHub Desktop.
Running WebDriver against Edge (Chromium)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | |
} |
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
Which version of Selenium.WebDriver are you using? Latest is 3.14.0 and there is no EdgeOptions constructer that takes 1 argument.