Skip to main content

Change screen orientation

Appium allows you to change the screen orientation of your iOS and Android devices.
You can choose to either change the orientation at the start of the test or during a test.

Set screen orientation at the start of your test

capabilities = {
  "appium:orientation" => "LANDSCAPE"
}
options.setCapability("appium:orientation", "LANDSCAPE");
$capabilities = [
  "appium:orientation" => "LANDSCAPE"
];
capabilities = {
  "appium:orientation": "LANDSCAPE"
}
const capabilities = {
  "appium:orientation": "LANDSCAPE"
};
options.AddAdditionalAppiumOption("appium:orientation", "LANDSCAPE");

Set screen orientation during a test

@driver.rotation = :landscape
((AppiumDriver) driver).rotate(ScreenOrientation.LANDSCAPE);
$driver->rotate("LANDSCAPE");
driver.orientation = "LANDSCAPE"
await driver.setOrientation('landscape');
driver.Orientation = ScreenOrientation.Landscape;
Was this page helpful?

Looking for More Help?

Have questions or need more information?
You can reach us via the following channels: