FileSystemManager Object

Applies to TestComplete 14.74, last modified on March 31, 2021

Description

The FileSystemManager object provides access to the file system of the connected Android device. You can use the object to work with the files and folders stored on the device.

To obtain the object in tests, use the Mobile.Device.FileSystemManager property.

Members

Example

The sample code below demonstrates how to access the connected Android device’s file system and copy a file from the local computer to the device:

JavaScript, JScript

function Test()
{

  var fileSystemManager = Mobile.Device("MyDevice").FileSystemManager;

  var pathOnDevice = "data/data";
  var pathOnHost = "C:\\TestComplete Work Folder\\Orders.apk";

  fileSystemManager.CopyToDevice(pathOnHost, pathOnDevice);

}

Python

def Test():

  fileSystemManager = Mobile.Device("MyDevice").FileSystemManager

  pathOnDevice = "data/data"
  pathOnHost = "C:\\TestComplete Work Folder\\Orders.apk"

  fileSystemManager.CopyToDevice(pathOnHost, pathOnDevice)

VBScript

Sub Test

  Set fileSystemManager = Mobile.Device("MyDevice").FileSystemManager

  pathOnDevice = "data/data"
  pathOnHost = "C:\TestComplete Work Folder\Orders.apk"

  Call fileSystemManager.CopyToDevice(pathOnHost, pathOnDevice)

End Sub

DelphiScript

procedure Test();
var fileSystemManager, pathOnDevice, pathOnHost;
begin

  fileSystemManager := Mobile.Device('MyDevice').FileSystemManager;

  pathOnDevice := 'data/data';
  pathOnHost := 'C:\TestComplete Work Folder\Orders.apk';

  fileSystemManager.CopyToDevice(pathOnHost, pathOnDevice);

end;

C++Script, C#Script

function Test()
{

  var fileSystemManager = Mobile["Device"]("MyDevice")["FileSystemManager"];

  var pathOnDevice = "data/data";
  var pathOnHost = "C:\\TestComplete Work Folder\\Orders.apk";

  fileSystemManager["CopyToDevice"](pathOnHost, pathOnDevice);

}

See Also

AndroidDevice Object
Testing Android Applications

Highlight search results