Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Nov 13, 2019 14:38

Perfecto Command



Copies a file from the repository to the device 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. This is supported for both interactive and automation testing.


NameTypePossible ValuesDescription
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 Perfecto Lab Repository, by logging into the Perfecto Lab interface.

To view/modify your private repository, use the repository manager.
The device file path, including root and file name, where to upload the file.
The root can be phone or card.
Example -

To view the device file system, login to the Perfecto Lab  interface and use the file transfer widget.

Return Value





Java sample
//declare the Map for script parameters
Map<String, Object> params = new HashMap<>();
params.put("handsetFile", "phone:/images/homeBtn.jpg");
params.put("repositoryFile", "PRIVATE:/images/homeBtn.jpg");
String res = (String) driver.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:/images/homeBtn.jpg");
pars.Add("repositoryFile", "PRIVATE:/images/homeBtn.jpg");
String res = (String) driver.ExecuteScript("mobile:media:put", pars);
JavaScript sample
var params = {handsetFile:'phone:/images/homeBtn.jpg', repositoryFile:'PRIVATE:/images/homeBtn.jpg'};
browser.executeScript('mobile:media:put', params);