New issue
Advanced search Search tips

Issue 889922 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Sep 28
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug-Regression



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:
 
OS is actually Ubuntu 16.04 but I don't think it matters as it doesn't seem to be OS related.
Labels: Needs-Bisect Needs-Triage-M69
Cc: viswa.karala@chromium.org
Components: Tests>WebDriver
Labels: Triaged-ET TE-NeedsTriageHelp
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!
I am not sure if it is a chromedriver issue, as it would seem related to  issue #879373 .
Status: WontFix (was: Unconfirmed)
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 .
So what’s the minimum width now?

How is one supposed to set mobile-like widths?
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).
Does it mean that #879373 is invalid?
Yes, I'd say that  issue #879373  is invalid.
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.
Sorry about the inconvenience. We are working on resolving issues with clicking in mobile emulation mode.

Sign in to add a comment