Bringing new life into Edge Selenium Tools
Tags: edge, selenium, python
Published: 2020-09-03 07:50:11

---
title: Bringing new life into Edge Selenium Tools
published: true
description: The new Edge browser is here with new automation tools.
tags: #Edge #Selenium #Python
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/iotsqp44zu59l4v5rz6v.png
---
This year, Microsoft Edge is officially reborn (in Chromium form) with tools to automate it, such as: https://github.com/microsoft/edge-selenium-tools -> "An updated EdgeDriver implementation for Selenium 3". This includes three separate libraries with implementations for C#, JavaScript, and Python. The upcoming Selenium 4 will include these libraries automatically, with the latest stable version of Selenium being ``3.141`` right now.

<p align="center"><a href="https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/">
<img src="https://dev-to-uploads.s3.amazonaws.com/i/zntds4kf7dt4qxcsl0v5.png" alt="WebDriver for Edge" width="400" /></a></p>

After spending some quality time using the new Edge and running automated browser tests on it with the Python ``edge-selenium-tools``, I can safely say that Edge can be used as a drop-in replacement for Chrome as needed for automated testing, with some small differences such as handling browser extensions. I'm also the creator of a test framework called [SeleniumBase](https://github.com/seleniumbase/SeleniumBase), which uses ``edge-selenium-tools`` and simplifies Edge automation by wrapping a complete framework around the APIs to enhance the automation experience.

<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/">
<img src="https://dev-to-uploads.s3.amazonaws.com/i/p566yg69qg2bstjofouf.gif" alt="Testing Edge with SeleniumBase" width="700" /></a></p>

(Above: [GitHub -> SeleniumBase/examples/edge_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/edge_test.py), which highlights key areas on the Edge "About" page.)

In order to make Edge automation work, you'll need EdgeDriver, which is normally obtained by going to https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ and then downloading the version you need. Thankfully, SeleniumBase lets you install the latest stable version of EdgeDriver in seconds by running a simple command:

```bash
$ seleniumbase install edgedriver

*** edgedriver version for download = 85.0.564.44

Downloading edgedriver_mac64.zip from:
https://msedgedriver.azureedge.net/85.0.564.44/edgedriver_mac64.zip ...
Download Complete!

Extracting ['msedgedriver'] from edgedriver_mac64.zip ...
Unzip Complete!

The file [msedgedriver] was saved to:
/Users/michael/github/SeleniumBase/seleniumbase/drivers/msedgedriver

Making [msedgedriver 85.0.564.44] executable ...
[msedgedriver] is now ready for use!
```

Also convenient is the ability to set Edge options from the command line when running tests with SeleniumBase. For example, you can activate the built-in [mobile-device emulator](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md) by simply running a test with ``--mobile``:

<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_skype_site.py">
<img src="https://dev-to-uploads.s3.amazonaws.com/i/6f58ovavsgkwkdrjgm80.gif" alt="Testing Skype Mobile with SeleniumBase" /></a></p>

(Above: [GitHub -> SeleniumBase/examples/test_skype_site.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_skype_site.py), which highlights key areas on Skype's mobile website.)

Including Edge as part of your test automation suite is more important than ever, especially since the marketshare of Edge is rapidly growing. If you're already using [SeleniumBase](https://github.com/seleniumbase/SeleniumBase), running a test with Edge is as easy as adding ``--browser=edge`` to your run command. This is one of the many ways that SeleniumBase expands on ``pytest`` command-line options. (For reference, [pytest](https://github.com/pytest-dev/pytest) is a unit-testing framework that can run SeleniumBase scripts.)

In summary, the new Edge browser is ready for your automated tests, and [SeleniumBase](https://github.com/seleniumbase/SeleniumBase) paired with [edge-selenium-tools](https://github.com/microsoft/edge-selenium-tools) can help you get started quickly. Visit the GitHub page at https://github.com/seleniumbase/SeleniumBase to learn more. There are many [example tests](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) to guide you in the right direction, and those can be run with ``--browser=edge`` to use Edge instead of the default browser.

Special thanks to John Jansen (https://twitter.com/thejohnjansen) for answering my Edge automation questions on Twitter. And thank you to Mat Velloso (https://twitter.com/matvelloso) for the nice shout-out there.

![Jansen and Velloso](https://dev-to-uploads.s3.amazonaws.com/i/zo1mojktmxa4ilinzy6c.png)

(Above: Tweets to me by John Jansen and Mat Velloso)

--------

About me: I'm Michael Mintz, currently the DevOps/Automation Lead at [iboss, (a Microsoft "Trusted Security Partner")](https://www.iboss.com/blog/iboss-delivers-saas-cloud-security-for-microsoft-azure/). In my spare time, I expand and maintain SeleniumBase (https://github.com/seleniumbase/SeleniumBase - https://seleniumbase.io/). Normally you'll find me around Boston, but I've been working from home for most of 2020. You can find me on Twitter: https://twitter.com/seleniumbase (and yes, I use that account far more frequently than my personal one).

<p align="center">
<img src="https://dev-to-uploads.s3.amazonaws.com/i/6578alqe7s55i3bes5lc.png" alt="Michael Mintz at the iboss booth" width="400" /></p>
<p align="center">(That's me on the right with the glasses and the hoodie.)</p>