FileSystemManager Object

Applies to TestComplete 15.62, last modified on March 14, 2024
The information below concerns legacy mobile tests that work with mobile devices connected to the local computer. For new mobile tests, we recommend using the newer cloud-compatible approach.

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 (Legacy)

Highlight search results