Legacy | Screenshot

  • Command: screen

  • Subcommand: image

  • 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

Captures an image of the current screen display, in the selected format. The digital screenshot included in the report. Additional configurations include capturing an analog image, saving the image in the repository, and reducing the image resolution for long scripts that result in large reports.

Use this function to see how the application looks at any given time during a script run. For additional time saving, enable the Grid label advanced parameter to generate a separate view mode with customizable screenshot labels.

You can also use this command for dynamic image validation during runtime. This means that during runtime, a device screenshot image can be saved to the repository and then compared to the current screen on the device to validate what was expected.

Restriction: This report feature is not available in QTP as it is unique to the IDE.

Parameters

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

primary (Primary)

camera (Camera)

best (Best)

secondary ()

high_res ()

 

Primary - Digital screen capture, if available.

Camera - Analog screen capture.

Secondary - Digital screen capture of the secondary display (flip closed), if relevant.

Best - Digital screen capture, if available. If not available or failed, analog screen capture.

key    

The full repository path, including directory and file name, where to save the image.

Example: PRIVATE:dir1/image.jpg

The image will always be available in the report.

format

jpg (jpg)

bmp (bmp)

png (png)

jpg

The image format

report.resolution

high (High)

medium (Medium)

low (Low)

High

The image resolution. It is recommended to reduce the resolution in very long scripts that result in large report files.

label     Enable grid report view for this function call, and customize the screenshot label.

* Mandatory parameter

Request & Response

Copy

Request

https://mycloud.perfectomobile.com/services/executions/john@perfectomobile.com_controller_16-11-08_13_44_00_1095?operation=command&securityToken=<your_token>&command=screen&subcommand=image&param.deviceId=6370E775&param.format=jpg&param.source=best
Copy

JSON response

{
    "executionId":"john@perfectomobile.com_controller_16-11-08_13_44_00_1095",
    "reason":"Success",
    "timer.elapsed":"1422",
    "testGridReportUrl":"https://mycloud.reporting-stg.perfectomobile.com?externalId[0]=john@perfectomobile.com_controller_16-11-08_13_44_00_1095",
    "timer.ux":"0",
    "singleTestReportUrl":"https://mycloud.perfectomobile.com/nexperience/singletest/report/?reportRepositoryKey=PRIVATE:controller/161108/controller_16-11-08_13_44_00_1095.xml&ownerId=john@perfectomobile.com&sharingCode=71a76172-e4d8-4d48-a224-7c618f7f1c37",
    "description":"Success",
    "timer.system":"1422",
    "reportKey":"PRIVATE:controller/161108/controller_16-11-08_13_44_00_1095.xml",
    "completed":"true",
    "flowEndCode":"SUCCEEDED",
    "timer.device":"0"}