Change screen orientation

You can change the screen orientation of an Android or iOS device to set your application in portrait or landscape mode during the execution of the test. Use the capability deviceOrientation to change the screen orientation.

Capability Description Values
deviceOrientation Set the screen orientation of mobile device portrait, landscape
Default: portrait

Example :

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("deviceOrientation", "landscape");
var capabilities = {
	'deviceOrientation': 'landscape',
}
DesiredCapabilities capability = new DesiredCapabilities();
capability.SetCapability("deviceOrientation", "landscape");
$capabilities = new DesiredCapabilities();
$capabilities->setCapability("deviceOrientation", "landscape");
desired_cap = {
	'deviceOrientation': 'landscape'
}
desired_caps = {
    'deviceOrientation': 'landscape'
}