# Selenium Library with Chromium Edge Browser

**URL:** <https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172>\
**Category:** SeleniumLibrary\
**Created:** [11 May 2020 09:14 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172 "2020-05-11T09:14:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohith\_Voleti](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@Rohith\_Voleti](https://forum.robotframework.org/u/Rohith_Voleti)\
**Post date:** [11 May 2020 09:14 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/1 "2020-05-11T09:14:41Z")

</div>

Hi Team,

I am working on project which have to deal with new Microsoft chromium Edge Browser. I was not able to access the browser elements. Could any one help me unblocking this issue. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![aaltat](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/aaltat/32/15_2.png) [@aaltat](https://forum.robotframework.org/u/aaltat)\
**Post date:** [11 May 2020 09:32 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/2 "2020-05-11T09:32:16Z")

</div>

Last time I looked one needed to do few things:

1. Install new Edge Chromium and the Edge chromium driver.
2. Install Selenium 4, still in prerelease phase, but should work fine.
3. Set [use\_chromium](https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium#selenium-400-alpha05-and-newer) as `True`. Something like this should work:  
`| Open Browser | url | edge | options=use_chromium=True | `

---

<div class="post-metadata">

**Author:** ![Rohith\_Voleti](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@Rohith\_Voleti](https://forum.robotframework.org/u/Rohith_Voleti)\
**Post date:** [11 May 2020 11:22 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/4 "2020-05-11T11:22:48Z")

</div>

I am trying to use the above mentioned steps. But I am facing an error saying, “Options object has no attribute use\_chromium”

---

<div class="post-metadata">

**Author:** ![aaltat](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/aaltat/32/15_2.png) [@aaltat](https://forum.robotframework.org/u/aaltat)\
**Post date:** [13 May 2020 05:23 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/5 "2020-05-13T05:23:14Z")

</div>

That usually indicates that Selenium 4 is not installed. Execute `pip list` and verify the Selenium version. If 4.0 is not installed, do `pip install -U --pre selenium`

---

<div class="post-metadata">

**Author:** ![vinaybond](https://avatars.discourse-cdn.com/v4/letter/v/c77e96/32.png) [@vinaybond](https://forum.robotframework.org/u/vinaybond)\
**Post date:** [26 August 2020 12:02 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/6 "2020-08-26T12:02:36Z")

</div>

There is an alternate way for that in case you do not want to upgrade to Selenium4.  
first Run msedgedriver.exe from the command line (i.e. msedgedriver.exe). It will start msedgedriver on port 9515 (you can choose port). Start the browser as given bellow.

`| Open Browser | url | edge | remote_url=http://locahost:9515 |`

Thanks  
Vinay

---

<div class="post-metadata">

**Author:** ![MrBIN89](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/mrbin89/32/448_2.png) [@MrBIN89](https://forum.robotframework.org/u/MrBIN89)\
**Post date:** [27 August 2020 15:00 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/7 "2020-08-27T15:00:45Z")

</div>

I wrote a plugin that helps to use Edge Chromium with SeleniumLibrary & 3rd selenium, it uses [[https://github.com/microsoft/edge-selenium-tools](https://github.com/microsoft/edge-selenium-tools)]([http://Selenium](http://Selenium) Tools For Microsoft Edge) and no need to update the selenium to alpha version.  
Think it could help you.

Tested versions:

- robotframework==3.1.2
- SeleniumLibrary ==4.3.0
- selenium==3.141.0
- MSEdgeDriver 84.0.524.0
- msedge-selenium-tools==3.141.2

Usage of plugin:  
Library SeleniumLibrary plugins=plugins.EdgePlugin  
Open Browser ${URL} Edge options=use\_chromium=True;headless=True

Plugin:  
import importlib  
from selenium import webdriver  
from SeleniumLibrary import BrowserManagementKeywords  
from SeleniumLibrary.utils import is\_truthy, is\_falsy  
from SeleniumLibrary.keywords.webdrivertools import WebDriverCreator, SeleniumOptions  
from msedge.selenium\_tools import Edge as EdgePluginDriver

```
class EdgePlugin(BrowserManagementKeywords):
    '''
    This plugin is used to adapt SeleniumLibrary to run Edge browser
    (even chromium based version) with stable selenium version (3.141).
    It uses special msedge-selenium-tools
    that allows driving the new Microsoft Edge (Chromium) browser
    and use the latest functionality with no need to update to the alpha 4th selenium version.
    '''

    def __init__ (self, ctx):
        BrowserManagementKeywords. __init__ (self, ctx)
        self._webdriver_creator = _EdgePluginWebDriverCreator(self.log_dir)

class _EdgePluginWebDriverCreator(WebDriverCreator):
    def __init__ (self, log_dir):
        self.log_dir = log_dir
        self.selenium_options = _EdgePluginSeleniumOptions()

    def create_edge(self, desired_capabilities, remote_url, options=None, service_log_path=None,
                    executable_path='msedgedriver.exe'):
        if is_truthy(remote_url):
            defaul_caps = webdriver.DesiredCapabilities.EDGE.copy()
            desired_capabilities = self._remote_capabilities_resolver(
                desired_capabilities, defaul_caps)
            return self._remote(desired_capabilities, remote_url)
        if is_falsy(executable_path):
            executable_path = self._get_executable_path(EdgePluginDriver)
        return EdgePluginDriver(options=options,
                                service_log_path=service_log_path,
                                executable_path=executable_path,
                                **desired_capabilities)

class _EdgePluginSeleniumOptions(SeleniumOptions):

    def _import_options(self, browser):
        if browser == 'edge':
            options = importlib.import_module('msedge.selenium_tools.options')
            return options.Options
        else:
            return super(_EdgePluginSeleniumOptions, self)._import_options(browser)
```

---

<div class="post-metadata">

**Author:** ![Wolfe1](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/wolfe1/32/3386_2.png) [@Wolfe1](https://forum.robotframework.org/u/Wolfe1)\
**Post date:** [17 September 2020 20:23 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/8 "2020-09-17T20:23:03Z")

</div>

@MrBIN89 Most appreciated, you saved us a lot of trouble 😀

---

<div class="post-metadata">

**Author:** ![oli129](https://avatars.discourse-cdn.com/v4/letter/o/bb73d2/32.png) [@oli129](https://forum.robotframework.org/u/oli129)\
**Post date:** [11 November 2020 13:36 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/9 "2020-11-11T13:36:26Z")

</div>

Hi MrBIN89,

I am relatively new to this, and I was wondering how to install your plugin to be able to use it with my robot scripts?  
Do I need to include in a .py as a resource?

Thank you very much for the help!  
Kind Regards,  
Oliver

---

<div class="post-metadata">

**Author:** ![Wolfe1](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/wolfe1/32/3386_2.png) [@Wolfe1](https://forum.robotframework.org/u/Wolfe1)\
**Post date:** [11 November 2020 15:21 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/10 "2020-11-11T15:21:19Z")

</div>

Hey @oli129,

I ended up taking that code and implementing it here:  
[https://github.com/Accruent/robotframework-zoomba/blob/master/src/Zoomba/Helpers/EdgePlugin.py](https://github.com/Accruent/robotframework-zoomba/blob/master/src/Zoomba/Helpers/EdgePlugin.py)

Some instructions on its use [can be found at the bottom of this section here](https://github.com/Accruent/robotframework-zoomba#getting-started).

If you wanted to use it with base SeleniumLibrary you would need to copy that file somewhere your code could access and then do something like:

```
Library SeleniumLibrary plugins=Path.To.EdgePlugin

Open Browser https://www.google.com browser=Edge options=use_chromium=True
```

---

<div class="post-metadata">

**Author:** ![oli129](https://avatars.discourse-cdn.com/v4/letter/o/bb73d2/32.png) [@oli129](https://forum.robotframework.org/u/oli129)\
**Post date:** [11 November 2020 16:27 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/11 "2020-11-11T16:27:59Z")

</div>

Hi @Wolfe1,

thank you very much for the quick input! I am looking into it now.  
When trying to use the base Selenium library, with the following method **Library SeleniumLibrary plugins=C:/SVN/edge\_chromium.py** it throws the following error:

> Initializing test library ‘SeleniumLibrary’ with arguments [plugins=C:/SVN/edge\_chromium.py] failed: Importing test library: ‘C:/SVN/edge\_chromium.py’ failed.

---

<div class="post-metadata">

**Author:** ![Wolfe1](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/wolfe1/32/3386_2.png) [@Wolfe1](https://forum.robotframework.org/u/Wolfe1)\
**Post date:** [11 November 2020 16:47 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/12 "2020-11-11T16:47:08Z")

</div>

So if that works you need to remove the ‘.py’ part at the end, and I would suggest naming the .py file to be the same as the class, ‘EdgePlugin’. Given I am not sure if thay path will work as it needs to be relative to the library import.

So with that said you would need to do something like:  
`Library | SeleniumLibrary | plugins=SVN.EdgePlugin`

Otherwise if you want to use that library I linked it it extends SeleniumLibrary so you would be able to work simply by installing it and using:

`Library | Zoomba.GUILibrary | plugins=Zoomba.Helpers.EdgePlugin`

---

<div class="post-metadata">

**Author:** ![oli129](https://avatars.discourse-cdn.com/v4/letter/o/bb73d2/32.png) [@oli129](https://forum.robotframework.org/u/oli129)\
**Post date:** [12 November 2020 23:27 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/13 "2020-11-12T23:27:30Z")

</div>

Hi @Wolfe1,

thank you very much for the ideas! Both of your solutions worked out great! I was able to execute my test following your description!

Again, I do appreciate your help!

---

<div class="post-metadata">

**Author:** ![ndbhamvani](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ndbhamvani/32/697_2.png) [@ndbhamvani](https://forum.robotframework.org/u/ndbhamvani)\
**Post date:** [16 March 2021 21:42 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/14 "2021-03-16T21:42:27Z")

</div>

This works for me, but I’m not sure how to automate legacy web applications within Edge Chromium IE Mode. Any ideas with that?

Is it possible to do something like:

> `Open Browser | url | edge | options=use_chromium=True; desired_capability=ie`

Any ideas would be appreciated.

---

<div class="post-metadata">

**Author:** ![leorush](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/leorush/32/84_2.png) [@leorush](https://forum.robotframework.org/u/leorush)\
**Post date:** [16 April 2021 18:18 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/15 "2021-04-16T18:18:55Z")

</div>

AFIAIK IE Mode just launches IE11 in Edge window

---

<div class="post-metadata">

**Author:** ![ndbhamvani](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ndbhamvani/32/697_2.png) [@ndbhamvani](https://forum.robotframework.org/u/ndbhamvani)\
**Post date:** [16 April 2021 18:31 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/16 "2021-04-16T18:31:46Z")

</div>

I guess what I’m asking is how do we get IE11 to open in Edge Chromium in this way so that I can launch and automate legacy sites? I don’t want to automate these in IE11 itself but in Edge Chromium in IE compatibility mode.

How do we do this within Robot Framework?

---

<div class="post-metadata">

**Author:** ![leorush](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/leorush/32/84_2.png) [@leorush](https://forum.robotframework.org/u/leorush)\
**Post date:** [17 April 2021 18:21 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/17 "2021-04-17T18:21:39Z")

</div>

Even if some magical way you colud do that, chromedriver cannot control IE.  
IE mode is IE browser in Edge tab, so to contol it you had to use IEdriver.

---

<div class="post-metadata">

**Author:** ![ndbhamvani](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ndbhamvani/32/697_2.png) [@ndbhamvani](https://forum.robotframework.org/u/ndbhamvani)\
**Post date:** [17 April 2021 18:58 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/18 "2021-04-17T18:58:54Z")

</div>

I understand what you mean, but that’s what I’m asking now. Using IEDriver, what are the options that we need to set and how do we write this in Robot Framework?

Even if it’s IEDriver that’s used, the ultimate aim is to launch and navigate through the site on a Edge Chromium.

---

<div class="post-metadata">

**Author:** ![leorush](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/leorush/32/84_2.png) [@leorush](https://forum.robotframework.org/u/leorush)\
**Post date:** [18 April 2021 18:46 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/19 "2021-04-18T18:46:59Z")

</div>

Just take IEDriver and automate IE. Fact that it will be launched inside Edge window changes nothing.

---

<div class="post-metadata">

**Author:** ![ndbhamvani](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/ndbhamvani/32/697_2.png) [@ndbhamvani](https://forum.robotframework.org/u/ndbhamvani)\
**Post date:** [19 April 2021 20:03 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/20 "2021-04-19T20:03:42Z")

</div>

Here is the issue:

When the web application is launched manually in Edge Chromium, it launches as expected. But, if the same site is launched via an automated Edge Chromium browser it doesn’t load. This doesn’t happen for other sites that aren’t reliant on IE compatibility mode.

It’s essential that a the automated test happens on Edge Chromium and not IE itself.

---

<div class="post-metadata">

**Author:** ![leorush](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/leorush/32/84_2.png) [@leorush](https://forum.robotframework.org/u/leorush)\
**Post date:** [20 April 2021 11:20 UTC](https://forum.robotframework.org/t/selenium-library-with-chromium-edge-browser/172/21 "2021-04-20T11:20:42Z")

</div>

Well, maybe you can combine info in this thread with SO

> <https://stackoverflow.com/questions/65902742/how-to-open-microsoft-edge-in-internet-explorerie-mode-using-python-and-seleni>

Good luck )
