Issue metadata
Sign in to add a comment
|
Window resize requested by Chromedriver fails for some viewport sizes
Reported by
antonell...@wahanda.com,
Sep 27
|
||||||||||||||||||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36
Steps to reproduce the problem:
1. Get the browser to resize to viewport {"width":519,"height":800} using chromedriver
What is the expected behavior?
The window should resize to the desired viewport.
What went wrong?
The window resizes to {"screenHeight":800,"screenWidth":582} instead.
See Selenium command log:
COMMAND GET "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/window/current/size"
DATA {}
RESULT {"height":1000,"width":1050}
COMMAND POST "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/execute"
DATA {"script":"return (function getViewportSize() {\n return {\n screenWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),\n screenHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0)\n };\n}).apply(null, arguments)","args":[]}
RESULT {"screenHeight":884,"screenWidth":1050}
COMMAND POST "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/window/current/size"
DATA {"width":519,"height":916}
COMMAND POST "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/execute"
DATA {"script":"return (function getViewportSize() {\n return {\n screenWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),\n screenHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0)\n };\n}).apply(null, arguments)","args":[]}
RESULT {"screenHeight":800,"screenWidth":582}
COMMAND GET "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/window/current/size"
DATA {}
RESULT {"height":916,"width":582}
COMMAND POST "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/execute"
DATA {"script":"return (function getViewportSize() {\n return {\n screenWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),\n screenHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0)\n };\n}).apply(null, arguments)","args":[]}
RESULT {"screenHeight":800,"screenWidth":582}
COMMAND POST "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/window/current/size"
DATA {"width":519,"height":916}
COMMAND POST "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/execute"
DATA {"script":"return (function getViewportSize() {\n return {\n screenWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),\n screenHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0)\n };\n}).apply(null, arguments)","args":[]}
RESULT {"screenHeight":800,"screenWidth":582}
COMMAND GET "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/window/current/size"
DATA {}
RESULT {"height":916,"width":582}
COMMAND POST "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/execute"
DATA {"script":"return (function getViewportSize() {\n return {\n screenWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),\n screenHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0)\n };\n}).apply(null, arguments)","args":[]}
RESULT {"screenHeight":800,"screenWidth":582}
COMMAND POST "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/window/current/size"
DATA {"width":519,"height":916}
[A few more attempts]
COMMAND POST "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/execute"
DATA {"script":"return (function getViewportSize() {\n return {\n screenWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),\n screenHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0)\n };\n}).apply(null, arguments)","args":[]}
RESULT {"screenHeight":800,"screenWidth":582}
COMMAND POST "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/window/current/size"
DATA {"width":519,"height":916}
COMMAND POST "/wd/hub/session/090a2979a23155389f9c5aca98dddd0c/execute"
DATA {"script":"return (function getViewportSize() {\n return {\n screenWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),\n screenHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0)\n };\n}).apply(null, arguments)","args":[]}
RESULT {"screenHeight":800,"screenWidth":582}
Did this work before? Yes 68.0.3440.106
Does this work in other browsers? Yes
Chrome version: 69.0.3497.92 Channel: stable
OS Version: Ubuntu 14.04
Flash Version:
,
Sep 27
Could it be related to https://bugs.chromium.org/p/chromium/issues/detail?id=879373 ?
,
Sep 28
,
Sep 28
As per steps to reproduce the problem in comment# 0, issue seems to be related top ChromeDriver, which is out of scope for TE to triage it. Hence adding TE-NeedsTriageHelp label to it and requesting someone from the Dev team have a look at this issue. Note: Tentatively adding Tests>WebDriver component to it. Thanks!
,
Sep 28
I am not sure if it is a chromedriver issue, as it would seem related to issue #879373 .
,
Sep 28
Chrome window has a minimum size, and it's not possible to set it smaller than the minimum size. The minimum width has increased recently, see issue #849784 .
,
Sep 28
So what’s the minimum width now? How is one supposed to set mobile-like widths?
,
Sep 28
The minimum width differs by the platform and system configuration, and is subject to change. Tests shouldn't rely on any specific minimum width. To test against mobile-like width, please use mobile emulation mode (http://chromedriver.chromium.org/mobile-emulation).
,
Oct 1
Does it mean that #879373 is invalid?
,
Oct 1
Yes, I'd say that issue #879373 is invalid.
,
Oct 3
Ok, I decided to give mobile emulation a go, but there is a known bug around clicking element: https://bugs.chromium.org/p/chromedriver/issues/detail?id=2144 I am now in a position in which I cannot test on mobile viewports if I upgrade to chrome v69.
,
Oct 3
Sorry about the inconvenience. We are working on resolving issues with clicking in mobile emulation mode. |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by antonell...@wahanda.com
, Sep 27