How to launch Edge browser in Selenium

Related Product On This Page What is a Selenium Edge Driver?June 25, 2026 · 7 min read · Tool Comparison

Related Product

How to establish Edge browser in Selenium

Launching Microsoft Edge in Selenium is a key step for ensuring cross-browser compatibility in web covering. With the Edge WebDriver, testers can automate browser actions, validate functionality, and run end-to-end test seamlessly on the Edge browser.

Overview

Automating Microsoft Edge with Selenium check that covering work seamlessly on one of the nigh widely used browsers, enhancing test coverage and delivering a ordered user experience.

How to Launch Edge Browser in Selenium (Steps)

  • Step 1: Install Java Development Kit (JDK): Download and configure the late JDK to enable Selenium script execution.
  • Step 2: Install an IDE: Use Eclipse, IntelliJ, or any favourite IDE to publish and manage Selenium scripts.
  • Step 3: Download Selenium WebDriver: Add Selenium WebDriver libraries to your projection for browser mechanization.
  • Step 4: Download Microsoft Edge WebDriver (msedgedriver.exe): Ensure the driver version matches your installed Edge browser.
  • Step 5: Set Path for EdgeDriver: Configure the scheme property in your codification to designate to msedgedriver.exe.
  • Step 6: Initialize EdgeDriver: Create an EdgeDriver instance in your Selenium script to launch the Edge browser.

This article explores the fundamental steps to launch Edge browser using Selenium WebDriver for automated examination. It also excuse how Mac users can screen on Edge legacy.

What is a Selenium Edge Driver?

The Selenium Edge Driver is a specialised WebDriver implementation that allows Selenium book to interact with the Microsoft Edge browser. It acts as a span between Selenium commands and the Edge browser, translate mechanisation instructions (like clicking a push, entering text, or navigating to a URL) into native browser activity.

EdgeDriver is required whenever exam need to be executed on the Microsoft Edge browser. By using it, tester can:

  • Launch and control Edge programmatically.
  • Perform end-to-end functional and UI tests.
  • Validate cross-browser compatibility for web applications.

Configuring the Edge Driver

To run Selenium tests on Microsoft Edge, the EdgeDriver must be properly configure. The following stairs outline the setup process:

Prerequisites:

  • Installing the Windows 10 environment on the machine to run tests for legacy versions (15,16,17) of Edge
  • Downloading accurate WebDriver server version
  • Ensuring that the updated version of Selenium is being used

Read More:

Now here are steps for contour.

  1. The primary step is to check the edition of the OS build being used. Based on the OS version flesh, download the comparable Edge driver.
  2. To check the OS Build, go toStart & gt; Settings & gt; System & gt; About. In the example in this article, OS version build is 17134.
  3. Download the driver for the craved Edge adaptation from theofficial germas per the OS version soma identified earlier. Once the zip file is downloaded, unzip it and simulate the .exe file to a specific location.
  4. The next step is to spell it in the project file. It ’ s assumed that the user knows.
    One can refer to this article on to understand how to set-up a canonical Selenium with Java labor in Eclipse IDE.
  5. Define the Edge driver with its accurate itinerary using the and instantiate the Edge driver.
// Set the driver route System.setProperty (`` webdriver.edge.driver '', `` C: //EdgeDriver.exe ''); // Start Edge Session WebDriver driver = new EdgeDriver (); driver.get (`` https: //google.com ''); driver.quit ();

Pro tip: Tools like SUSA can handle this autonomously — upload your app and get results without writing a single test script.

How to Launch Edge Browser in Selenium?

At this point, the Edge driver has been configure. Now here ’ s perform a sample test scenario. In this scenario, the code will automatise 3 key steps:

  1. Launch the Edge browser
  2. Navigate to the Google site
  3. Enter “ BrowserStack Guide ” as a search query

Note:To interact with web-elements, one must know how to locate component inSelenium. Refer to this detailed guide on to learn about it in detail.

Code for launching Edge Browser using Selenium:

import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; significance org.openqa.selenium.WebDriver; import org.openqa.selenium.edge.EdgeDriver; public class Edge_Test {public static vacancy primary (String [] args) {//Setting system properties of EdgeDriver System.setProperty (`` webdriver.edge.driver '', `` C: //EdgeDriver.exe ''); //Creating an object of EdgeDriver WebDriver driver = new EdgeDriver (); driver.manage () .window () .maximize (); //Deleting all the biscuit driver.manage () .deleteAllCookies (); //Specifiying pageLoadTimeout and Implicit wait driver.manage () .timeouts () .pageLoadTimeout (40, TimeUnit.SECONDS); driver.manage () .timeouts () .implicitlyWait (30, TimeUnit.SECONDS); //launching the specified URL driver.get (`` https: //www.google.com/ ''); //Locating the elements using gens locator for the text box driver.findElement (By.name (`` q '')) .sendKeys (`` BrowserStack Guide ''); // locater for Google search button WebElement searchIcon = driver.findElement (By.name (`` btnK '')); searchIcon.click ();}}

Executing the playscript above will launch the Edge browser, navigate to the Google website, and enroll the term BrowserStack Guide as a search inquiry.

Also Read:How to run Selenium Tests on IE using.

Launch Edge Browser in Selenium on Real Devices using BrowserStack Automate

To launch Edge browser on real device using Selenium follow the below steps:

1. Navigate to BrowserStack ’ s homepage and fromProfile & gt; & gt; Summary pagefetch the username and admittance key.

2. Navigate to page to take from a comprehensive set of pick.

3. In the below exemplar Edge browser is launched on Windows with OS version 11.

4. In any java editor, create a Maven project and add Selenium Java, and TestNG dependencies.

& lt; dependencies & gt; & lt; dependency & gt; & lt; groupId & gt; org.seleniumhq.selenium & lt; /groupId & gt; & lt; artifactId & gt; selenium-java & lt; /artifactId & gt; & lt; version & gt; 4.5.0 & lt; /version & gt; & lt; /dependency & gt; & lt; dependency & gt; & lt; groupId & gt; org.testng & lt; /groupId & gt; & lt; artifactId & gt; testng & lt; /artifactId & gt; & lt; version & gt; 7.6.1 & lt; /version & gt; & lt; scope & gt; compile & lt; /scope & gt; & lt; /dependency & gt; & lt; /dependencies & gt;

Code snip:

import java.net.MalformedURLException; import java.util.HashMap; significance java.net.URL; import org.openqa.selenium.MutableCapabilities; importee org.openqa.selenium.WebDriver; import org.openqa.selenium.remote.RemoteWebDriver; import org.testng.Assert; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class EdgeBrowser {public static String username = `` & lt; BrowserStack username & gt; ''; public static String accesskey = `` & lt; BrowserStack accesskey & gt; ''; public static concluding String URL = `` https: // '' + username + ``: '' + accesskey + `` @ hub-cloud.browserstack.com/wd/hub ''; WebDriver driver; String url = `` https: //www.google.com/ ''; MutableCapabilities capabilities = new MutableCapabilities (); HashMap & lt; String, Object & gt; bstackOptions = new HashMap & lt; String, Object & gt; (); @ BeforeTest public void setUp () throws MalformedURLException, InterruptedException {bstackOptions.put (`` browserName '', `` Edge ''); bstackOptions.put (`` os '', `` Windows ''); bstackOptions.put (`` osVersion '', `` 11 ''); bstackOptions.put (`` browserVersion '', `` latest ''); capabilities.setCapability (`` bstack: options '', bstackOptions); driver = new RemoteWebDriver (new URL (URL), capability);} @ Test (priority = 1) public void launchGoogle () {driver.get (url); Assert.assertEquals (driver.getTitle (), `` Google '');} @ AfterTest public void tearDown () {driver.quit ();}}

5. After running the above program, you can check the solvent on the Automate Dashboard page.

You also get to see the execution picture. You can have access to text, network, and other logs as easily!

To automate the like test on any other Windows OS, choose the desired set from the Capabilities Generator page and update the capabilities in the Java code and execute the programme from the editor once again.

Talk to an Expert

Refresh the Automate splashboard page to see the test results for the new Platform OS.

Why use BrowserStack Automate for Selenium Tests?

Here & # 8217; s why you should use BrowserStack Automate to run your Selenium Tests

  1. Parallel Testing:BrowsersStack ’ s Automate product supports parallel testing by which one can easily test their app on a pool of combinations of device and browser type. This ultimately helps in cut the performance time conduct to run on different platforms and devices and therefore giving quick feedback of the covering ’ s execution.
  2. Real Devices and Browsers:It is always wise to test the application on real devices and browser to simulate a real user experience. Testing on existent device gives the actual sureness about the application performance. Functional testing and even non-functional testing such performance, burden and protection should be performed on real devices as testing on emulators may not give accurate effect. With Automate one can prove on any up-to-the-minute mobile gimmick or web browser without the overhead of buy a physical twist.
  3. Dedicated Dashboard:Running Selenium tryout lawsuit on Automate product, creates a account in a dashboard which can be refer to contend and monitor the automation testing activeness. The splashboard provides an overview of the testing status as Pass/Fail/Pending with all the environment details such as device name, OS version, Platform, browser name, browser version, test execution clip and duration, screenshots, etc. It too maintains a history of test executions.
  4. Custom Reports with Artifacts:In Automate, custom account can be generated to provide elaborate and customized reports for the automated tryout execution. With this feature it allows to customize the structure and message of the report as per exploiter ’ s want. It can include a Brobdingnagian compass of trial data such as test executing status, device and browser form, test duration, video transcription, screenshots, etc.
  5. Easy Integration with CI/CD Pipeline:BrowserStack ’ s Automate product can be seamlessly integrated with popular CI/CD tools such as Jenkins, TeamCity, TravisCI. With CI/CD in spot, the team can achieve faster speech cycles with great confidence in the dependability, execution and compatibility of the application across different devices and platforms.

Conclusion

BrowserStack ’ s enables Windows and Mac users to do both manual and for their web-applications on 3500+ real device and browser. This see that teams can do comprehensive for their web-applications in. BrowserStack also grant them to lead and on existent iOS and Android device.

Tags
38,000+ Views

# Ask-and-Contributeabout this topic with our Discord community.

Related Guides

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free