Delete file (FR)
Perfecto Command
mobile:media:delete
Purpose
Deletes a single or multiple files from the device storage. Use the File transfer widget to identify the device folder and file name.
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 delete all files in a folder, use a wildcard. 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
iOS
Copy
Java
//declare the Map for script parameters
Map<String, Object> params = new HashMap<>();
params.put("handsetFile", "phone:/Media/image.png");
driver.executeScript("mobile:media:delete", params);
Copy
JavaScript
var params = {handsetFile:'phone:/Media/image.png'};
browser.executeScript('mobile:media:delete', params);
Copy
C#
//declare the Map for script parameters
Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.Add("handsetFile", "phone:/Media/image.png");
driver.ExecuteScript("mobile:media:delete", pars);
Android
Copy
Java
//declare the Map for script parameters
Map<String, Object> params = new HashMap<>();
params.put("handsetFile", "phone:/sdcard/DCIM/Camera/image.png");
driver.executeScript("mobile:media:delete", params);
Copy
JavaScript
var params = {handsetFile:'phone:/sdcard/DCIM/Camera/image.png'};
browser.executeScript('mobile:media:delete', params);
Copy
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");
driver.ExecuteScript("mobile:media:delete", pars);