DEV Community

Cover image for Bringing new life into Edge Selenium Tools
Michael Mintz
Michael Mintz

Posted on • Updated on

Bringing new life into Edge Selenium Tools

This year, Microsoft Edge is officially reborn (in Chromium form) with tools to automate it, such as: -> "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.

WebDriver for Edge

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, which uses edge-selenium-tools and simplifies Edge automation by wrapping a complete framework around the APIs to enhance the automation experience.

Testing Edge with SeleniumBase

(Above: GitHub -> SeleniumBase/examples/, 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 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:

$ seleniumbase install edgedriver

*** edgedriver version for download = 85.0.564.44

Downloading from: ...
Download Complete!

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

The file [msedgedriver] was saved to:

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 by simply running a test with --mobile:

Testing Skype Mobile with SeleniumBase

(Above: GitHub -> SeleniumBase/examples/, 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, 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 is a unit-testing framework that can run SeleniumBase scripts.)

In summary, the new Edge browser is ready for your automated tests, and SeleniumBase paired with edge-selenium-tools can help you get started quickly. Visit the GitHub page at to learn more. There are many example tests 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 ( for answering my Edge automation questions on Twitter. And thank you to Mat Velloso ( for the nice shout-out there.

Jansen and Velloso

(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"). In my spare time, I expand and maintain SeleniumBase ( - Normally you'll find me around Boston, but I've been working from home for most of 2020. You can find me on Twitter: (and yes, I use that account far more frequently than my personal one).

Michael Mintz at the iboss booth

(That's me on the right with the glasses and the hoodie.)

Top comments (13)

sreidhark profile image

Hi Mr Mintz,
I am really surprised by the kind of work you put in seleniumbase.

Just started using this , but is there a way to use this in Behave(BDD) as the step functions don't work with classes and I don't see a way to use BaseCase from a normal function.
Appreciate your help.


mintzworld profile image
Michael Mintz

Hi Sri,
Thank you. There's a special format for using SeleniumBase without BaseCase. This is done by using SeleniumBase as a pytest fixture. Here's an example of that:
This format may be needed when using other pytest fixtures in your tests.

# "sb" pytest fixture test in a method with no class
def test_sb_fixture_with_no_class(sb):"")
    sb.type('input[title="Search"]', 'SeleniumBase\n')'a[href*=""]')'a[title="seleniumbase"]')

# "sb" pytest fixture test in a method inside a class
class Test_SB_Fixture():
    def test_sb_fixture_inside_class(self, sb):"")
        sb.type('input[title="Search"]', 'SeleniumBase\n')'a[href*=""]')'a[title="examples"]')
Enter fullscreen mode Exit fullscreen mode
sreidhark profile image

Thanks, Let me try and update you.

Thread Thread
sreidhark profile image

Sorry for the trouble as I am completely new to behave.
what is "sb" ? Is it an object of some class that needs to eb instantiated in some fixture definition ?
Help appreciated.


Thread Thread
mintzworld profile image
Michael Mintz

You're probably looking for , which explains pytest vs behave and has a link to pytest-bdd.

sb is the pytest fixture for SeleniumBase. Using SeleniumBase-as-a-fixture gives you the compatibility that you need to use pytest-bdd fixtures in your code at the same time, such as scenario, given, when, and then. Details on pytest-bdd can be found here: . That is completely separate from SeleniumBase, but pytest does allow for the use of multiple fixtures at the same time.

Thread Thread
sreidhark profile image

Thanks for the quick response. I will try.

Thread Thread
sreidhark profile image

Sorry for the long post, I am trying to run sb without pytest. I found this code below from your examples.

1) Are all these settings mandatory ?

2)I am trying to use Allure reports, but its seems sb.pytest_html_report = "sb_report.html" is not generating any report , nor even logs in sb.log_path = "latest_logs/"

3) Eventually I want to create an object of sb and call from behave test steps, some how fixtures thing above didnt work for me . I want to create a SeleniumBase object in environment file before a feature starts running and use the same in test steps.

I have tried writing my own framework, but somehow I keep coming back to your work as I know I cant produce such a comprehensive and stable work ( Kudos!)



from seleniumbase import BaseCase

class MyTestClass(BaseCase):

def test_basic(self):"")
    self.type('input[name="q"]', "xkcd book")'input[value="Search"]')
    self.assert_text("xkcd: volume 0", "h3")"")
    self.assert_title("xkcd: Python")
    self.assert_text("free to copy and reuse")
    self.assert_exact_text("", "h2")
    self.assert_element("#comic img")
Enter fullscreen mode Exit fullscreen mode

if name == "main":
sb = MyTestClass("test_basic")
sb.browser = "chrome"
sb.headless = False
sb.headed = True
sb.start_page = None
sb.locale_code = None
sb.servername = "localhost"
sb.port = 4444 = None
sb.environment = "test"
sb.user_agent = None
sb.incognito = False
sb.guest_mode = False
sb.devtools = False
sb.mobile_emulator = False
sb.device_metrics = None
sb.extension_zip = None
sb.extension_dir = None
sb.database_env = "test"
sb.log_path = "latest_logs/"
sb.archive_logs = False
sb.disable_csp = False
sb.disable_ws = False
sb.enable_ws = False
sb.enable_sync = False
sb.use_auto_ext = False
sb.no_sandbox = False
sb.disable_gpu = False
sb._reuse_session = False
sb._crumbs = False
sb.visual_baseline = False
sb.maximize_option = False
sb.save_screenshot_after_test = False
sb.timeout_multiplier = None
sb.report_on = True
sb.pytest_html_report = "sb_report.html"
sb.with_db_reporting = False
sb.with_s3_logging = False
sb.js_checking_on = False
sb.is_pytest = False
sb.slow_mode = False
sb.demo_mode = False
sb.time_limit = None
sb.demo_sleep = 1
sb.message_duration = 2
sb.block_images = False
sb.settings_file = None
sb.user_data_dir = None
sb.proxy_string = None
sb.swiftshader = False
sb.ad_block_on = False
sb.highlights = None
sb.check_js = False
sb.cap_file = None
sb.cap_string = None

    del sb
Enter fullscreen mode Exit fullscreen mode


Thread Thread
mintzworld profile image
Michael Mintz

1) When using a hack like to avoid using pytest, the variables still need to be initialized because pytest is no longer initializing them.
2) To get a pytest html report, add --html=report.html from the pytest command line (not the test itself!). For the Allure report, use --alluredir=ALLURE_DIR on the command line.
3) When using other pytest fixtures, you need to use SeleniumBase as a fixture for compatibility. See: for an example of the sb fixture.

Thread Thread
sreidhark profile image

2) Sorry, forgot to mention. I need the report when NOT running from pytest. How do I pass these arguments when running from main?


Thread Thread
mintzworld profile image
Michael Mintz

Hi Sri, those reports are specific to pytest plugins: pytest-html and allure-pytest. You'll need to use pytest for those reports to be generated.

Thread Thread
sreidhark profile image


pjcalvo profile image
Pablo Calvo

Hey man thanks for sharing. Huge fan of SeleniumBase here. I am happy to hear that Edge people is making an effort for those who have been in Selenium 3 for a while.

Keep the posts coming.

mintzworld profile image
Michael Mintz

Thank you for the kind words. I'll keep the posts coming. :)