Legacy | Rotate device

  • Command: device

  • Subcommand: rotate

  • Supported Platforms: Native (legacy), UFT (legacy), Selenium, Appium

    All commands must be executed using the same framework. Sharing the execution ID between different frameworks is not possible. This means that if you work with a Selenium/Appium driver, you need to call the commands using the Selenium/Appium driver (or, in the case of Reporting commands, through the Reporting SDK that works with the driver) and not as part of a UFT test or another framework.

  • Supported OS: Android, iOS

Description

Rotates the device to either landscape or portrait. To rotate the device orientation, set method to Device. This will affect the screen orientation as well. To rotate the device view without manipulating the device screen, set method to be View. The Next parameter value in operation enables a 90° rotation.

The Rotate device function performs the same operation as the Rotate option in the Manual Testing view.

The operation and state parameters cannot be used together because they dictate a different behavior.

Parameters

Name Value Default Description
deviceID*     The device for this command.
operation

reset (Reset)

next (Next)

 

The state operation to perform on the device.

Reset - rotate the device to its default state

Next - rotate the device to its next state

method

device (Device)

view (View)

Device

The rotation method.

Device - Rotate the device orientation (landscape/portrait)

View - Rotate the displayed image only

state

portrait (Portrait)

landscape (Landscape)

 

The device screen rotation state.

Portrait

Landscape

* Mandatory parameter

Request & Response

Copy

Request

https://mycloud.perfectomobile.com/services/executions/john@perfectomobile.com_controller_16-11-03_06_48_09_368?operation=command&securityToken=<your_token>&command=device&subcommand=rotate&param.deviceId=6370E775&param.state=portrait
Copy

JSON response

{
    "executionId":john@perfectomobile.com_controller_16-11-03_06_48_09_368,
    "reason":Success,
    "timer.elapsed":1313,
    "testGridReportUrl":https://mycloud.reporting-stg.perfectomobile.com?externalId[0]=john@perfectomobile.com_controller_16-11-03_06_48_09_368,
    "timer.ux":1313,
    "singleTestReportUrl":https://mycloud.perfectomobile.com/nexperience/singletest/report/?reportRepositoryKey=PRIVATE:controller/161103/controller_16-11-03_06_48_09_368.xml&amp;ownerId=john@perfectomobile.com&amp;sharingCode=552eb965-0a26-45e9-a8ef-4a10b362be22,
    "description":Success,
    "timer.system":0,
    "reportKey":PRIVATE:controller/161103/controller_16-11-03_06_48_09_368.xml,
    "completed":true,
    "flowEndCode":SUCCEEDED,
    "timer.device":1313
}