applitools / eyes.webdriverio.javascript

Eyes SDK for WebDriverIO 4. This repository is deprecated. It has moved to https://github.com/applitools/eyes.sdk.javascript1/tree/master/packages/eyes-webdriverio-4
Other
10 stars 11 forks source link

'Failed to set/get viewport size' error in Mobile Android Browser #16

Closed klamping closed 6 years ago

klamping commented 6 years ago

When trying to run checkWindow in Mobile Android, I'm getting the following error:

Failed to set/get viewport size: The URL '/wd/hub/session/XXXXXXXX-XXXX-XXXX-XXXX-XXXX29b676bc/window/rect' did not map to a valid resource
running Chrome
Error: The URL '/wd/hub/session/XXXXXXXX-XXXX-XXXX-XXXX-XXXX29b676bc/window/rect' did not map to a valid resource
    at pause(200) - index.js:267:37
    at execute("var origOverflow = document.documentElement.style.overflow; document.documentElement.style.overflow = "hidden"; return origOverflow", ) - index.js:267:37
    at elements() - isExisting.js:46:17
    at isExisting() - at windowHandleSize() - index.js:267:37

My capabilities:

{
  browserName: 'Chrome',
  deviceName: 'Android Emulator',
  deviceOrientation: 'portrait',
  platformVersion: '6.0',
  platformName: 'Android',
},

From a quick investigation, it looks like Applitools is trying to get the browser size via windowHandleSize, but Android (and maybe all mobile browsers?) don't support that endpoint.

I'm guessing a conditional will need to be added to only check for windowHandleSize if it's not a mobile browser.

danielputerman commented 6 years ago

Fixed in https://github.com/applitools/eyes.webdriverio.javascript/pull/14, and available in npm since version 1.1.1 .