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
Copy
capabilities = {
"appium:orientation" => "LANDSCAPE"
}
Copy
options.setCapability("appium:orientation", "LANDSCAPE");
Copy
$capabilities = [
"appium:orientation" => "LANDSCAPE"
];
Copy
capabilities = {
"appium:orientation": "LANDSCAPE"
}
Copy
const capabilities = {
"appium:orientation": "LANDSCAPE"
};
Copy
options.AddAdditionalAppiumOption("appium:orientation", "LANDSCAPE");
Set screen orientation during a test
Copy
@driver.rotation = :landscape
Copy
((AppiumDriver) driver).rotate(ScreenOrientation.LANDSCAPE);
Copy
$driver->rotate("LANDSCAPE");
Copy
driver.orientation = "LANDSCAPE"
Copy
await driver.setOrientation('landscape');
Copy
driver.Orientation = ScreenOrientation.Landscape;