WebDriver for Microsoft Edge Browser
Introduction
In this post, we will discuss WebDriver for Microsoft Edge Browser, the new addition to the Browser family by Microsoft. Also, we will look at the sample code to run the edge browser. Initially, Microsoft Edge was developed by the code name Project Spartan, which is a web browser developed by Microsoft and is part of Microsoft Windows 10 OS. Furthermore, it’s now the default browser on Windows 10 operating system.
Edge is designed to be a modern, lightweight, fast web browser with a layout engine built around the latest web standards. It shreds a lot of legacy technologies such as ActiveX.
Microsoft WebDriver
Microsoft has announced support for automated testing of Microsoft Edge through the W3C WebDriver standard. To use WebDriver with Microsoft Edge, we need the Microsoft Edge WebDriver server on Windows 10. Microsoft WebDriver closes the loop of the developer cycle by automating testing of the website in Microsoft Edge Browser.
Like all other browsers you need a driver to interact with Edge browser from within your WebDriver tests.Also, with this capability, Microsoft Edge can be run through automated testing as other browsers, helping developers and testers to identify issues with less effort and demonstrate that the website works for the end-users.
The WebDriver API is a platform and language-neutral interface and wire protocol allowing programs or scripts to control the behavior of a web browser. Therefore, Microsoft Edge implementation of WebDriver supports commands from both the W3C WebDriver Specification and the JSON Wire Protocol.
Getting started with WebDriver for Microsoft Edge
You need the Windows 10 operating system.
Download the appropriate Microsoft WebDriver server for your build of Windows 10 operating system.
You can download the driver here :
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Download the latest WebDriver language binding of your choice ( version 3.0 )
Example binding C#, Java, JavaScript language bindings etc.
We can find sample flow of commands from selenium test to Edge browser below :
Sample code
A sample test is written in Java that runs a sample test on Edge Browser.
public class MicrosoftEdgeExample { @Test public void sampleEdgeTest() { // i just placed the executable in project's root System.setProperty("webdriver.edge.driver", "MicrosoftWebDriver.exe"); WebDriver driver=new EdgeDriver(); driver.get("https://www.bing.com"); driver.quit(); } }
Free Test Virtual Machines Download
Test Microsoft Edge using free virtual machines you can download and manage locally.
You can download Free VM’s to test on Microsoft Edge locally using the link below:
https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
Please note that these virtual machines expire after 90 days trial period. Also, I recommend setting a snapshot as soon as you spin the VM, which you can roll back to later with a small overhead of reverting time. Furthermore, the above page has detailed instructions on how to set up the VM on different platforms.
Selenium WebDriver Tutorials on this website can be found at:
https://www.testingdocs.com/selenium-webdriver-tutorial
For more details on the Selenium, visit the official website at: