MS Edge webdriver - lessons learned

The market share of the MS Edge browser is low. Just look it up on netmarketshare.com. But that doesn't mean it does not need to be tested. Especially since it will replace IE at some point in time. Therefore you also need to think about test automation. I had my fair share of ups and downs when it comes to testing on the Edge browser that I would like to share with you. The short summary is that MS Edge webdriver is not matture enough for test automation. But you can prepare for it.

List of issues I faced

Setup

  • Ruby version 2.5 
  • lapis_lazuli 2.1.3
  • Microsoft Edge 16.16299

Issues clicking elements - Check the zoom level

First of all make sure the zoom level is at 100% since click events will otherwise fail. Not a big issue, you just need to set/check this once and you're done.

More strict than others

Context:

With lapis_lazuli you can find elements within another element by using the higher element as 'context'. Since lapis_lazuli is basically a extension build on the watir gem, you can use elements located in the Watir way or in the lapis_lazuli way. There is one catch. When you want to use an element (located the Watir way) as a context element, this does not work in Edge. It will just ignore the context element for some reason. So best practice if you are using the lapis_lazuli gem is to always use the lapis_lazuli style of finding elements to prevent this issue with the Edge browser. Below a small example:

Filter_by:

If you try to find an element (see example above), lapis_lazuli automatically filters on `filter_by: :present?`, so keep that in mind, you only need to add this when you want/need to switch it to `:visible?` or `:exists?`. And that is exactly what we need with the Edge browser. The reason is that the browsers interpet `:present?` differently per browser, so here's another tip to find the right (amount) of element(s) in each browser.

Trailing white space

Another minor issue is that Edge could add a trailing white space in the results, see: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14907415/ and 
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/5569343/

Microsoft Web Driver can't be used with the Built-In Administrator account or while User Account Control is turned off

All previous items have simple workarounds so let's start with some more serious issues. On one of the VM's I use in the selenium-grid I had this issue. Luckely there was a solution which I posted here: https://stackoverflow.com/questions/41461217/microsoftwebdriver-fails-when-constructing-while-running-under-teamcity-agents/47883971#47883971

Clear or delete cookies not possible

This one is blocking for me since I need to perform cookie checks/actions to make sure I'm logged in or logged out. And only when this issue is resolved I'll put Edge back on the radar for my test automation suite.To describe the issue in short. things like browser.cookies.clear is not possible, it just does not clear the cookie. Also browser.cookie.delete 'acceptedCookies' does not work so I'm stuck there.
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14838528/

Failed to open TCP connection to localhost

And last but not least, from time to time you will loose the connection to the browser. This makes it unreliable for test automation and is another reason I think this driver is just not stable enough yet, see: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14835845/

More links/info

There are more issues with the webdriver but also more features planned to be build. For issue tracking, keep an eye on this link: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/ 
For the latest status of the webdriver, keep an eye on this page: https://docs.microsoft.com/en-us/microsoft-edge/webdriver 
Latest status regarding selenium compatibility: http://webdriver-herald.herokuapp.com/

Hopefully this was helpful to you. Leave a comment for questions and suggestions.

Comments

Popular posts from this blog

PowerShell - How to overcome Azure VM's fixed resolution limitation

TA Basics: Website Test Automation on mobile devices via Appium server

TA: Who doesn't like proxies? Me!