Forum Discussion
Chromium Edge automation with selenium (best practice)
- Jul 18, 2019
johnjansen actually it do not open with the edge:
i installed Edge dev Version 77.0.211.3, and Edge Canary Version 77.0.218.4 too. And I use the Version: 77.0.219.0 driver. My test open chrome, not edge. I tried with chromeoption, with System.setProperty, but still. Can you help me what I do wrong? Thanks!
mmiky123
Please help me understand here, the only action taken here is to rename msedgedriver.exe to chromedriver.exe? Rest entire code remains the same as if we were using chromedriver? If so is the case can you please help me understand what to expect when we launch broswer
? Are we expecting chrome or edge to launch when ran in non headless mode?
Thank you
- ChrisCSQSJan 24, 2020Copper Contributor
- johnjansenJan 14, 2020Former Employee
nhatekar yes. Really the best way is to update to the Alpha build of Selenium 4 because that's where we updated Selenium to recognize the new Edge browser.
Here is just a quick C# example that works with Selenium 4 (you can get it from nuget or here:
// EdgeOptions() requires using OpenQA.Selenium.Edge // Construct EdgeOptions with is_legacy = false var edgeOptions = new EdgeOptions(false); edgeOptions.BinaryLocation = @"C:\Program Files (x86)\Microsoft\Edge Dev\Application\msedge.exe"; var msedgedriverDir = @"c:\drivers"; 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"; - nhatekarJan 13, 2020Copper Contributor
Is there a straight forward way to use and launch the Edge Chromium driver with Selenium? Thank you.
- PrasanthRVNov 28, 2019Copper Contributor
Team , I am unable to run the selenium tests in Chrome and Edge(Chromium) in parallel mode . Separately , I am able to execute tests in either of the browsers , but in parallel mode ,only one test is getting succeeded.
- johnjansenJul 21, 2019Former Employee
mmiky123 Yes, that's correct. Each browser must have it's own Driver that specifically runs that version of the browser. So if you want to automate the Old Edge, you'd use MicrosoftWebDriver. If you want to automate the new Edge, you'd use MSEdgeDriver (and for the time being, tell it where to find the EXE to launch msedge.exe instead of chrome.exe).
- mmiky123Jul 21, 2019Copper ContributorHi. So it looks like the chromium edge driver is specifically tailored to chromium edge and its functionality, so it is by default searching for a chromium edge installation. From there it is just like the chromedriver with its functionality.
- johnjansenJul 16, 2019Former Employee
aseema31 for the time being (hopefully not too much longer), yes, sort-of. You want to use the Chrome* classes and explicitly point them to the msedge on your machine. When the language bindings are all updated and stable, then you can rename to use Edge* classes.
Here is a code sample in C# for what I mean:
var anaheimService = ChromeDriverService.CreateDefaultService(@"c:\drivers", "msedgedriver.exe"); var anaheimOptions = new ChromeOptions { BinaryLocation = @"C:\Users\johnjan\AppData\Local\Microsoft\Edge SxS\Application\msedge.exe" }; //anaheimOptions.AddArgument("--headless"); driver = new ChromeDriver(anaheimService, anaheimOptions);