ProjectSuite.FileName Property

Applies to TestComplete 15.70, last modified on December 17, 2024

Description

The FileName property returns the fully-qualified name (with file path and extension) of the .pjs file that holds the current TestComplete project suite.

Declaration

ProjectSuite.FileName

Read-Only Property String

Applies To

The property is applied to the following object:

Property Value

A string that represents the file name (with file’s path and extension) of the current project suite in TestComplete.

Example

The following example demonstrates how to obtain the name of the current project suite’s file and how to copy the file to the specified folder.

JavaScript, JScript

function ProjectSuiteSample()
{
  var PSName, NewPath;

  // Obtains the name of the current project suite’s file with the full path to it
  PSName = ProjectSuite.FileName;
  // Specifies the destination path
  NewPath = "..\\..\\..\\Temp\\TempProjectSuite.pjs";
  // Copies the project suite file
  if (aqFile.Copy(PSName, NewPath))
    Log.Message("The file has been copied successfully")
  else
    Log.Error("Failed to copy the file");
  …
}

Python

def ProjectSuiteSample():
  # Obtains the name of the current project suite's file with the full path to it 
  PSName = ProjectSuite.FileName
  # Specifies the destination path 
  NewPath = "..\\..\\..\\Temp\\TempProjectSuite.pjs"
  # Copies the project suite file 
  if aqFile.Copy(PSName, NewPath):
    Log.Message("The file has been copied successfully")
  else:
    Log.Error("Failed to copy the file")

VBScript

Sub ProjectSuiteSample

  Dim PSName, NewPath

  ' Obtains the name of the current project suite’s file with the full path to it
  PSName = ProjectSuite.FileName
  ' Specifies the destination path
  NewPath = "..\..\..\Temp\TempProjectSuite.pjs"
  ' Copies the project suite file
  If aqFile.Copy(PSName, NewPath) Then
    Log.Message "The file has been copied successfully"
  Else
    Log.Error "Failed to copy the file"
  End If
  …
End Sub

DelphiScript

procedure ProjectSuiteSample();
var PSName, NewPath;

begin
  // Obtains the name of the current project suite’s file with the full path to it
  PSName := ProjectSuite.FileName;
  // Specifies the destination path
  NewPath := '..\..\..\Temp\TempProjectSuite.pjs';
  // Copies the project suite file
  if aqFile.Copy(PSName, NewPath) then
    Log.Message('The file has been copied successfully')
  else
    Log.Error('Failed to copy the file');
  …
end;

C++Script, C#Script

function ProjectSuiteSample()
{
  var PSName, NewPath;

  // Obtains the name of the current project suite’s file with the full path to it
  PSName = ProjectSuite["FileName"];
  // Specifies the destination path
  NewPath = "..\\..\\..\\Temp\\TempProjectSuite.pjs";
  // Copies the project suite file
  if (aqFile["Copy"](PSName, NewPath))
    Log["Message"]("The file has been copied successfully")
  else
    Log["Error"]("Failed to copy the file");
  …
}

See Also

ProjectSuite.Path
ProjectSuite.ConfigPath
Project.Path
Project.FileName

Highlight search results