0

Previously it was possible to check device orientation

driver.getOrientation()

In appium java-client 8.3 this method is no longer available. How to check current device orientation now?

Jake Green
  • 53
  • 1
  • 7

2 Answers2

0

Found it - Mobile specific extensions have been respectively moved to IOSDriver and AndroidDriver.

Jake Green
  • 53
  • 1
  • 7
0

You will need to cast the driver. From Java Client 8.x.x and Appium 2.0, mobile specific extension commands have been moved to respective drivers.

Basically, if you have initialised the driver like below,

AppiumDriver driver = new AndroidDriver() or
AppiumDriver driver = new IOSDriver(),

Then, cast the driver like below,

((AndroidDriver) driver).getOrientation(); OR
((IOSDriver) driver).getOrientation();

This way, you access the mobile specific extension commands.