DeviceAction - Landscape And Portrait
Description
You can toggle the orientation of the device reflection by using the key events for Landscape and Portrait.
info
This command is supported in Android only. Android version must be 4.1 or above when using non-instrumented applications.
Usage
Using command to toggle orientation on an Android device to landscape mode by sending the text 'Landscape' or to portrait by sending 'Portrait'
info
Replace <server> with the appropriate URL.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
Example
Landscape and Portrait
DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "<deviceid>");
...
...
//This command sets the orientation to Portrait or Landscape.
seetest.deviceAction("Portrait");
seetest.deviceAction("Landscape");