ericmckean / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

Support setting screen orientation on mobile device #921

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Command to support: 
https://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionI
d/orientation

DevTools: search for "setDeviceOrientationOverride" in 
https://chromium.googlesource.com/chromium/blink/+/master/Source/devtools/protoc
ol.json.

Original issue reported on code.google.com by k...@google.com on 7 Oct 2014 at 5:21

GoogleCodeExporter commented 9 years ago
Also possibly via desired capabilities -- would enable a higher level test 
framework to specify orientation at the test definition level declaratively, 
and the test runner would inject it into the new session requests.

Original comment by k...@google.com on 7 Oct 2014 at 5:26

GoogleCodeExporter commented 9 years ago

Original comment by st...@chromium.org on 7 Oct 2014 at 5:44

GoogleCodeExporter commented 9 years ago
driver.context("NATIVE_APP");
driver.rotate(ScreenOrientation.LANDSCAPE);
driver.context("WEBVIEW_1");

Original comment by kwtmay...@gmail.com on 10 Oct 2014 at 9:42

GoogleCodeExporter commented 9 years ago
(ChromeDriver v.2.12) I tried to emulate proper screen orientation through 
deviceMetrics, but it won't work. These statement pairs produce the same result:
    deviceMetrics.put("height", 1024);
    deviceMetrics.put("width", 850);
and
    deviceMetrics.put("height", 850);
    deviceMetrics.put("width", 1024);

In both cases I get portrait orientation.             

I cannot use driver.context() workaround, because the driver I create is an 
instance of ChromeDriver with mobileEmulation set up through ChromeOptions. No 
such method is defined for it.

Original comment by darina.s...@gmail.com on 10 Nov 2014 at 12:38

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:18

GoogleCodeExporter commented 9 years ago
Issue 1068 has been merged into this issue.

Original comment by samu...@chromium.org on 2 Apr 2015 at 10:17

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 2 Apr 2015 at 10:17