- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to 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"); } }
Output
- Related Articles
- Using the Selenium WebDriver - Unable to launch chrome browser on Mac
- How to launch Chrome Browser via Selenium?
- How can I download Microsoft WebDriver/Edge Driver to use with Selenium?
- Clear browser Cookies with Selenium WebDriver Java bindings.
- Capturing browser logs with Selenium WebDriver using Java.
- How does selenium webdriver upload files to the browser?
- How to connect to an already open browser using Selenium Webdriver?
- How to open a browser window in full screen using Selenium WebDriver with C#?
- How does Selenium Webdriver handle the SSL certificate in Edge?
- How to close child browser window in Selenium WebDriver using Java?
- How to maximize the browser window in Selenium WebDriver using C#?
- Why does the Selenium WebDriver have an edge over Selenium RC?
- How do I set browser width and height in Selenium WebDriver?
- How to start selenium browser with proxy?
- How to open browser window in incognito/private mode using python selenium webdriver?
