WebdriverIO DevTools Edge driver options
tswiftma

tswiftma @tswiftma

About: Software automation guy to pay for my mountain biking equipment. Read some of my Dev.to blog entries on Automation, XUnit, dotnet, Azure!

Location:
Boston, Massachusetts
Joined:
Feb 9, 2021

WebdriverIO DevTools Edge driver options

Publish Date: Sep 29 '21
9 2

I recently needed to add Microsoft Edge browser coverage to my Webdriver.IO tests. But when I added 'edge' (or 'MicrosoftEdge') as the browserName in the wdio.config.js capabilities, a couple of problems occurred:

1) browser.maximizeWindow( ) in my test project stopped working with the following error "Error: Command "maximizeWindow" is not yet implemented". It still works for chrome however. I found that quite a few people were hitting this problem but there really wasn't a solution available. I think that the problem lies with the actual MicrosoftEdge driver itself. So as a workaround I now always start the browsers in wdio.config.js with the args option '--start-maximized'. I also stopped using the call browser.maximizeWindow() altogether.

2) When the Edge browser came up it only used a defaultViewport of 1200x800 even if the browser was maximized. This was weird because my web app would only use part of the browser display. Looking at the WebdriverIO run logs showed that devtools:puppeteer was starting Edge with the option "defaultViewport":{"width":1200,"height":900}. I have no idea why it would default to this! The workaround was to set a 'wdio:devtoolsOptions' value for defaultViewport to null.

Below is the code to add to wdio.conf.js. Hope this is helpful in getting Microsoft Edge to run with WebdriverIO!

    capabilities: [
      // more capabilities defined here
      // or override capabilities from wdio.conf.js      
      {
        maxInstances: 1,
        browserName: 'edge',
        'ms:edgeOptions': {
          args: ['--start-maximized']
        },
        acceptInsecureCerts: true,
        //
        // Edge launches via devtools/puppeteer.
        // Need to set defaultViewport to null to use the whole browser
        'wdio:devtoolsOptions': {
          defaultViewport: null
        }
      }
    ],
Enter fullscreen mode Exit fullscreen mode

Comments 2 total

  • PiratePeter
    PiratePeterMar 30, 2022

    I only created an account to say thanks. This helped me a lot. 👍

  • sudha-test
    sudha-testMay 4, 2022

    How to resolve this issue with edge even i am facing the same

Add comment