FindFolders Method

Applies to TestComplete 15.64, last modified on May 16, 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.


Use the FindFolders method to search the connected Android device or a folder on the Android device for subfolders that match the specified pattern.



ProgObj An expression, variable or parameter that specifies a reference to one of the objects listed in the Applies To section
FolderMask [in]    Required    String    
Result An aqObjIterator object

Applies To

The method is applied to the following objects:


The method has the following parameter:


Specifies the mask of the folders to search for. A mask can include the * and ? wildcard characters. An asterisk corresponds to a string of any length, a question mark - to any single character.

The mask is case-sensitive.

Result Value

The aqObjIterator objects whose items are AndroidFolder objects that store information about the matching folders.

To get information on individual folders, you can call the iterator’s Next and Item method and use the properties of the returned AndroidFolder object.


The sample code below demonstrates how to use the method to search the connected device for folders that contain the word sys in their name:

JavaScript, JScript

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

  var folders = fileSystemManager.FindFolders("*sys*");
  if (folders.Count > 0)
    while (folders.HasNext())
      var folder = folders.Next();

    Log.Warning("No folders were found.");



def Test():
  fileSystemManager = Mobile.Device("MyDevice").FileSystemManager

  folders = fileSystemManager.FindFolders("*sys*")
  if folders.Count > 0:
    while folders.HasNext:
      folder = folders.Next
    Log.Warning("No folders were found.")


Sub Test

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

  Set folders = fileSystemManager.FindFolders("*sys*")
  If folders.Count > 0 Then
    While folders.HasNext
      Set folder = folders.Next

    Log.Warning("No folders were found.")
  End If

End Sub


procedure Test();
var fileSystemManager, folders, folder;
  fileSystemManager := Mobile.Device('MyDevice').FileSystemManager;

  folders := fileSystemManager.FindFolders('*sys*');
  if folders.Count > 0 then
      while folders.HasNext do
        folder := folders.Next;

    Log.Warning('No folders were found.');


C++Script, C#Script

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

  var folders = fileSystemManager["FindFolders"]("*sys*");
  if (folders["Count"] > 0)
    while (folders["HasNext"]())
      var folder = folders["Next"]();

    Log["Warning"]("No folders were found.");


See Also

FileSystemManager Object
AndroidFolder Object
aqObjIterator Object
Testing Android Applications (Legacy)

Highlight search results