How To Launch Edge Browser Using Microsoft WebDriver
How To Launch Edge Browser Using Microsoft WebDriver:
Pre-requisites to use Edge with Selenium WebDriver:
- Windows 10
- Microsoft WebDriver
Download Microsoft WebDriver from here to launch Edge Browser. Download the proper version of the driver based on your OS build number. If the extension of the downloaded file is “.msi“, you need to install it to get the “.exe” driver.
Here in this post, we see how to run Selenium WebDriver Script in Edge Browser using Microsoft WebDriver
Assuming that you have already Installed Selenium WebDriver.
If you want to install Selenium WebDriver, click on the link below to install Selenium WebDriver in few clicks.
How To Download And Install Selenium WebDriver
Each and every browser has its own Driver to execute Selenium WebDriver Scripts. Selenium WebDriver supports browsers such as Mozilla Firefox, Google Chrome, Internet Explorer, Opera, Safari etc.,
How to Run Selenium Webdriver Script in Firefox browser – Old Version
How to Run Selenium Webdriver Script in Firefox browser – Gecko Driver
How to Run Selenium Webdriver Script in Internet Explorer
How to Run Selenium WebDriver Script in Chrome Browser
Execute the following script to launch Edge browser. It first lanuches Edge Browser and then open appropriate URL mentioned in the script. In order to launch Edge Browser, we need to specify the system property with the path of the MicrosoftWebDriver.exe file.
SCRIPT:
package seleniumTutorial; import org.openqa.selenium.WebDriver; import org.openqa.selenium.edge.EdgeDriver; public class GeckoDriver { public static void main(String[] args) { //Change the path based on your file path //System.setProperty("webdriver.edge.driver","Path of geckodriver.exe") System.setProperty("webdriver.edge.driver","D://Selenium Training//Selenium Environment Files//MicrosoftWebDriver.exe"); WebDriver driver = new EdgeDriver(); driver.navigate.to("https://www.softwaretestingmaterial.com/software-testing-interview-questions-free-ebook/"); System.out.println("Selenium Webdriver Script to launch edge browser using Microsoft WebDriver | Software Testing Material"); driver.close(); } }
If you are not regular reader of my blog then I highly recommend you to signup for the free email newsletter using the below link.