Search in sources :

Example 6 with DeviceRotation

use of org.openqa.selenium.DeviceRotation in project java-client by appium.

the class AppiumDriver method rotation.

@Override
public DeviceRotation rotation() {
    Response response = execute(DriverCommand.GET_SCREEN_ROTATION);
    DeviceRotation deviceRotation = new DeviceRotation((Map<String, Number>) response.getValue());
    if (deviceRotation.getX() < 0 || deviceRotation.getY() < 0 || deviceRotation.getZ() < 0) {
        throw new WebDriverException("Unexpected orientation returned: " + deviceRotation);
    }
    return deviceRotation;
}
Also used : Response(org.openqa.selenium.remote.Response) DeviceRotation(org.openqa.selenium.DeviceRotation) WebDriverException(org.openqa.selenium.WebDriverException)

Aggregations

DeviceRotation (org.openqa.selenium.DeviceRotation)6 Test (org.junit.Test)5 WebDriverException (org.openqa.selenium.WebDriverException)1 Response (org.openqa.selenium.remote.Response)1