Hi ,
I need to change the device orientation to landscape what could be the code for it…when i use screenorientation.landscape() the page alone is changed…
Hi ,
I need to change the device orientation to landscape what could be the code for it…when i use screenorientation.landscape() the page alone is changed…
Deepika,Use this code to change the device Orientation
app.getOrientation();
if (rotateAction.equalsIgnoreCase("PORTRAIT")) {
if (!orientation.value().equalsIgnoreCase(rotateAction)) {
app.rotate(ScreenOrientation.PORTRAIT);
}
}
private void setDeviceRotation(String deviceName) {
if (deviceName.contains(IPHONE)) {
iosDriver.rotate(ScreenOrientation.PORTRAIT);
Log.info("Set rotation portrait mode for " + deviceName);
}
if (deviceName.contains(IPAD)) {
iosDriver.rotate(ScreenOrientation.LANDSCAPE);
Log.info("Set rotation landscape mode for " + deviceName);
}
}
Thank you but i have used the same but still getting the same error.
my screen is looking in this way
code snippet:
driver.rotate(ScreenOrientation.LANDSCAPE);
ScreenOrientation.LANDSCAPE - it will rotate the only screen.
Why do you need to rotate device?
But when i was using 1.6.3 version of appium the device was changing to landscape…
Something Wrong in appium