Legacy | Put file

  • Command: media

  • Subcommand: put

  • 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

Copies a file from the repository to the device's file system. Within iOS applications, you can use this command to place a file in any of the following folders as well: Documents, Library, tmp. If the specified folder does not exist, the command will create the folder before copying the file. This command is supported for automation testing. For interactive testing, you can use the Transfer a file option.

Parameters

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

The device file path, including root and file name, where to upload the file.

The root can be phone or card.

Example: phone:/images/myImage.jpg

To view the device file system, log in to the Mobile cloud interface and use the file transfer widget.

repositoryFile*    

The full repository path, including directory and file name, where the file is located.

Example: PRIVATE:dir1/dir2/name.jpg

Click browse and navigate to the file.

The file must first be uploaded to the MobileCloud Repository, by logging in to the Mobile Cloud interface.

To view/modify your private repository, use the repository manager.

* Mandatory parameter

Request & Response

Copy

Request


          https://mycloud.perfectomobile.com/services/executions/john@perfectomobile.com_controller_16-11-07_09_47_45_487?operation=command&securityToken=<your_token>&command=media&subcommand=put&param.deviceId=6370E775&param.  
Copy

JSON response

{
    "executionId":"john@perfectomobile.com_controller_16-11-07_13_32_13_507",
    "reason":"Success",
    "timer.elapsed":"3234",
    "testGridReportUrl":"https://mycloud.reporting-stg.perfectomobile.com?externalId[0]=john@perfectomobile.com_controller_16-11-07_13_32_13_507",
    "timer.ux":"3093",
    "singleTestReportUrl":"https://mycloud.perfectomobile.com/nexperience/singletest/report/?reportRepositoryKey=PRIVATE:controller/161107/controller_16-11-07_13_32_13_507.xml&ownerId=john@perfectomobile.com&sharingCode=b3c4ded3-b894-45c0-b1f5-fa2fe4ee7086",
    "description":"Success",
    "timer.system":"141",
    "reportKey":"PRIVATE:controller/161107/controller_16-11-07_13_32_13_507.xml",
    "completed":"true",
    "flowEndCode":"SUCCEEDED",
    "timer.device":"3093"}