
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Launch Edge Browser with Selenium WebDriver
We can launch Edge browser with Selenium webdriver by using the Microsoft webdriver. We should also ensure that we are having the machine with the Windows 10 operating system.
Navigate to the below link to download the Microsoft Edge driver executable file − https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Once the page is launched, scroll down to the Downloads section, then choose and click the link which is compatible with our local Edge browser version.
A zip file gets created, once the download is completed successfully. We have to then unzip the file and save it in a desired location. Then, set the path of the msedgedriver.exe file. This is done by utilizing the System.setProperty method.
Finally we have to create an instance of the EdgeDriver class.
Syntax
System.setProperty("webdriver.edge.driver", "C:\Users\ghs6kor\Desktop\Java\msedgedriver.exe"); WebDriver d = new EdgeDriver();
Example
import org.openqa.selenium.WebDriver; import org.openqa.selenium.edge.EdgeDriver; public class EdgeBrwser{ public static void main(String[] args) { //set path of msedgedriver.exe path System.setProperty("webdriver.edge.driver", "C:\Users\ghs6kor\Desktop\Java\msedgedriver.exe"); //instance of EdgeDriver WebDriver driver = new EdgeDriver(); //URL launch driver.get("https://www.tutorialspoint.com/index.htm"); } }