Legacy | Start image injection

  • Command: image.injection

  • Subcommand: start

  • 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

Retrieves an image from the repository. Perfecto supplies this image to the specified application when the application tries to retrieve a camera image. The application must have been installed with sensor instrumentation.

To use this command, one of the two application identifiers is required. For information on retrieving the application identifier, see Application identifier.

Image injection continues for this application until activating the Stop Image Injection function.

Restriction: Image injection is supported for the front and back cameras of Android devices and the back camera of iOS devices. It is not supported for the front-camera of iOS devices.

Parameters

Name Values Default Description

deviceId*



The device for this command.

repositoryFile*



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

Example: PRIVATE:dir1/dir2/name.png

Click browse and navigate to the file. Supported image formats: jpeg, jpg, png, bmp.

name



The application name as it is displayed on the device screen.

identifier



The identifier of the application.

adjustment

1-200


Use if the injection process fails to locate the image frame. This parameter reduces the image size to create blank space around the image, which in turn enables the injection process to locate the image frame and scan the code. For more information on image injection with adjustment, see the Perfecto Knowledgebase.

* Mandatory parameter

Request & Response

Copy

Request


            https://mycloud.perfectomobile.com/services/executions/john@perfectomobile.com_controller_16-11-08_12_29_30_1017?operation=command&securityToken=<your_token>&command=image.injection&subcommand=start&param.deviceId=6BA14A93C1DE5748D3E65C555CCE67FCC9EBD4CA&param.repositoryFile=PUBLIC:CameraInjectionApps/check.jpg&param.identifier=Victor.RealTimeFilter
Copy

JSON response

{
    "executionId":"john@perfectomobile.com_controller_16-11-08_12_29_30_1017",
    "reason":"Success",
    "timer.elapsed":"4516",
    "testGridReportUrl":"https://mycloud.reporting-stg.perfectomobile.com?externalId[0]=john@perfectomobile.com_controller_16-11-08_12_29_30_1017",
    "timer.ux":"0",
    "singleTestReportUrl":"https://mycloud.perfectomobile.com/nexperience/singletest/report/?reportRepositoryKey=PRIVATE:controller/161108/controller_16-11-08_12_29_30_1017.xml&ownerId=john@perfectomobile.com&sharingCode=4320eb56-834b-44b8-9ad4-a514f4f5f7d7",
    "description":"Success",
    "timer.system":"4516",
    "reportKey":"PRIVATE:controller/161108/controller_16-11-08_12_29_30_1017.xml",
    "completed":"true",
    "flowEndCode":"SUCCEEDED",
    "timer.device":"0"}