Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & App Percy

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 capabilities = new DesiredCapabilities();
HashMap<String, Object> browserstackOptions = new HashMap<String, Object>();
browserstackOptions.put("deviceOrientation", "landscape");
var capabilities = {
	'bstack:options' : {
		"deviceOrientation" : "landscape",
	},
}
AppiumOptions capabilities = new AppiumOptions();
Dictionary<string, object> browserstackOptions = new Dictionary<string, object>();
browserstackOptions.Add("deviceOrientation", "landscape");
$caps = array(
    'bstack:options' => array(
        "deviceOrientation" => "landscape",
    ),
)
desired_cap = {
	'bstack:options' : {
		"deviceOrientation" : "landscape",
	},
}
capabilities = {
    'bstack:options' => {
        "deviceOrientation" => "landscape",
    },
}

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Download Copy