Put file (FR)
Perfecto Command
mobile:media:put
Purpose
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 |
Type |
Possible Values |
Description |
---|---|---|---|
repositoryFile |
Multimedia |
|
The full repository path, including directory and file name, where the file is located. Example: Click browse and navigate to the file. The file must first be uploaded to the Perfecto Lab Repository, by logging into the Perfecto Lab interface. To view/modify your private repository, use the repository manager. |
handsetFile |
String |
|
The device file path, including root and file name, where to upload the file. The root can be phone or card. Examples: To view the device file system, log in to the Perfecto Lab interface and use the file transfer widget. |
Return Value
None
Exceptions
None
Examples
Java
//declare the Map for script parameters
Map<String, Object> params = new HashMap<>();
params.put("handsetFile", "phone:/Media/image.png");
params.put("repositoryFile", "PRIVATE:image.png");
driver.executeScript("mobile:media:put", params);
JavaScript sample
var params = {handsetFile:'phone:/Media/image.png', repositoryFile:'PRIVATE:image.png'};
browser.executeScript('mobile:media:put', params);
C# sample
//declare the Map for script parameters
Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.Add("handsetFile", "phone:/Media/image.png");
pars.Add("repositoryFile", "PRIVATE:image.png");
driver.ExecuteScript("mobile:media:put", pars);
Java
//declare the Map for script parameters
Map<String, Object> params = new HashMap<>();
params.put("handsetFile", "phone:/sdcard/DCIM/Camera/image.png");
params.put("repositoryFile", "PRIVATE:image.png");
driver.executeScript("mobile:media:put", params);
JavaScript
var params = {handsetFile:'phone:/sdcard/DCIM/Camera/image.png', repositoryFile:'PRIVATE:image.png'};
browser.executeScript('mobile:media:put', params);
C# sample
//declare the Map for script parameters
Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.Add("handsetFile", "phone:/sdcard/DCIM/Camera/image.png");
pars.Add("repositoryFile", "PRIVATE:image.png");
driver.ExecuteScript("mobile:media:put", pars);