# How can I download Microsoft WebDriver/Edge Driver to use with Selenium?

SeleniumAutomation TestingTesting Tools

#### The Complete Selenium WebDriver with Java Course

192 Lectures 20 hours

#### Mastering XPath and CSS Selector for Selenium

47 Lectures 3 hours

We can download Microsoft/Edge Driver to use with Selenium. The Microsoft Edge driver allows communication of the tests developed in Selenium with the Edge browser.

Then move to the Downloads section, and click on the link based on the local operating system and browser version we have.

Once the download is completed, a zip file gets saved. It needs to be extracted and stored in a location. After extracting it, the executable file - msedgedriver.exe file is to be kept at a desired location.

We have to configure the path of the msedgedriver.exe file using the System.setProperty method along with creating an object of the EdgeDriver class.

## Syntax

System.setProperty("webdriver.edge.driver", "C:\Users\ghs6kor\Desktop\Java\msedgedriver.exe");
WebDriver driver = new EdgeDriver();

## Example

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class EdgeBrwserLaunch{
public static void main(String[] args) {
//configure path of msedgedriver.exe path
System.setProperty("webdriver.edge.driver",
"C:\Users\ghs6kor\Desktop\Java\msedgedriver.exe");
//object of EdgeDriver
WebDriver driver = new EdgeDriver();
//URL launch
driver.get("https://www.yahoo.com/");
//get browser name
Capabilities c = ((RemoteWebDriver) driver).getCapabilities();
System.out.println("Browser: " + c.getBrowserName());
driver.quit();
}
}

## Output

Updated on 06-Apr-2021 11:29:20