C# Sample for automating MS Edge (Chromium) browser using edge web driver RRS feed

  • General discussion

  • Please follow steps below to create C# MS Edge(Chromium) auto testing program:

    (1) Download the specific version of MS Edge (Chromium) WebDriver from link below and store it on desired location.

    Download MS Edge (Chromium) web driver

    (2) Create a C# Console Application using Visual Studio

    (3) Download Selenium C# binding packages using Manage NuGet packages option.

    (4) Leverage ChromeDriver() to start the auto test with ChromeOptions identifying MS Edge (Chromium)  exe file location



    C# Sample code for MS Edge (Chromium) Webdriver.

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using OpenQA.Selenium; using OpenQA.Selenium.Chrome; using OpenQA.Selenium.Edge; using OpenQA.Selenium.Remote; using OpenQA.Selenium.Support.UI; namespace ConsoleApp2 { class Program { static void Main(string[] args) { var anaheimService = ChromeDriverService.CreateDefaultService(@"D:\", " msedgedriver.exe ");

    // user need to pass the driver path here.... var anaheimOptions = new ChromeOptions {

    // user need to pass the location of new edge app here....
    BinaryLocation = @"

    C: \Program Files(x86)\Microsoft\Edge Dev\Application\msedge.exe "

    }; IWebDriver driver = new ChromeDriver(anaheimService, anaheimOptions); driver.Navigate().GoToUrl("https: //"); Console.WriteLine(driver.Title.ToString()); driver.Close(); } } }

    Monday, August 12, 2019 9:24 AM