How to check if current Orientation is Portrait?
public boolean Method_isCurrentOrientationPortrait(AppiumDriver driver) {
String ort = driver.getOrientation().name();
ScreenOrientation orientation = ScreenOrientation.valueOf(ort);
if (orientation == ScreenOrientation.PORTRAIT) {
return true;
} else {
return false;
}
}