ParentFolder Property

Applies to TestComplete 14.10, last modified on June 5, 2019

Description

The ParentFolder property returns an aqFolderInfoObj object that describes the parent folder of the given folder.

Declaration

aqFolderInfoObj.ParentFolder

Read-Only Property An aqFolderInfo object.
aqFolderInfoObj An expression, variable or parameter that specifies a reference to an aqFolderInfo object

Applies To

The property is applied to the following object:

Property Value

An aqFolderInfo object that provides access to the parent folder.

Example

The code below obtains information about the specified folder's parent folder, gets the parent folder's size and posts this size to the test log.

JavaScript, JScript

function ParentFolderExample()
{

 // Sets the path to the desired folder
 sPath = "C:\\MyFiles\\Music";
 
 // Obtains information about the parent folder
 FoldInfo = aqFileSystem.GetFolderInfo(sPath).ParentFolder;
 
 // Posts the size of the parent folder to the test log
 Log.Message("The parent folder's size is: " + IntToStr(FoldInfo.Size) + " bytes");
 
}

Python

def ParentFolderExample():
  # Sets the path to the desired folder
  sPath = "C:\\MyFiles\\Music"
  # Obtains information about the parent folder
  FoldInfo = aqFileSystem.GetFolderInfo(sPath).ParentFolder
  # Posts the size of the parent folder to the test log
  Log.Message("The parent folder's size is: " + IntToStr(FoldInfo.Size) + " bytes")

VBScript

Sub ParentFolderExample

 ' Sets the path to the desired folder
 sPath = "C:\MyFiles\Music"
 
 ' Obtains information about the parent folder
 Set FoldInfo = aqFileSystem.GetFolderInfo(sPath).ParentFolder
 
 ' Posts the size of the parent folder to the test log
 Log.Message("The parent folder's size is: " + IntToStr(FoldInfo.Size) + " bytes")
 
End Sub

DelphiScript

function ParentFolderExample;
var sPath, FoldInfo;
begin

 // Sets the path to the desired folder
 sPath := 'C:\MyFiles\Music';
 
 // Obtains information about the parent folder
 FoldInfo := aqFileSystem.GetFolderInfo(sPath).ParentFolder;
 
 // Posts the size of the parent folder to the test log
 Log.Message('The parent folder"s size is: ' + IntToStr(FoldInfo.Size) + ' bytes');
 
end;

C++Script, C#Script

function ParentFolderExample()
{

 // Sets the path to the desired folder
 sPath = "C:\\MyFiles\\Music";
 
 // Obtains information about the parent folder
 FoldInfo = aqFileSystem["GetFolderInfo"](sPath)["ParentFolder"];
 
 // Posts the size of the parent folder to the test log
 Log["Message"]("The parent folder's size is: " + IntToStr( FoldInfo["Size"] ) + " bytes");
 
}

See Also

Working With Files From Scripts
aqFileSystem.GetFolderInfo Method
Name Property
Path Property
Drive Property

Highlight search results