Get file (FR)
Perfecto Command
mobile:media:get
Purpose
Copies a file from the device's file-system to the Perfecto Repository. Provides the full specification of the file location in the Repository and the target file location (including the file name) on the device.
Parameters
Name |
Type |
Possible Values |
Description |
---|---|---|---|
handsetFile |
String |
The device file path, including root and file name, where the file is located. The root can be phone or card. Examples: To retrieve all files in a folder, use a wildcard. Examples: When using a wildcard, the Repository key parameter should specify a folder. To view the device file system, log in to the Perfecto Lab interface and use the file transfer widget. |
|
repositoryFile |
String |
The full repository path, including directory and file name, where to save the file. Example: |
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:get", params);
JavaScript sample
var params = {handsetFile:'phone:/Media/image.png', repositoryFile:'PRIVATE:image.png'};
browser.executeScript('mobile:media:get', 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:get", 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:get", params);
JavaScript
var params = {handsetFile:'phone:/sdcard/DCIM/Camera/image.png', repositoryFile:'PRIVATE:image.png'};
browser.executeScript('mobile:media:get', 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:get", pars);