ProjectSuite.ConfigPath Property

Applies to TestComplete 14.20, last modified on September 11, 2019

Description

This property returns the path to the folder that contains configuration files of the current TestComplete project suite.

Declaration

ProjectSuite.ConfigPath

Read-Only Property String

Applies To

The property is applied to the following object:

Property Value

A string that denotes the path to the folder that holds configuration files of the current project suite in TestComplete.

Example

The following example demonstrates how to determine the path to the folder that stores the current project suite’s configuration files and to check whether the .tcCFGExtender file holding the project suite’s settings resides in this folder.

JavaScript, JScript

function ProjectSuiteSample()
{

  var ConfigPath, ConfigFiles, aFile;

  // Obtains the path to the folder that stores the project suite configuration files
  ConfigPath = ProjectSuite.ConfigPath;
  // Searches for the .tcCFGExtender files in the folder
  ConfigFiles = aqFileSystem.FindFiles(ConfigPath, "*.tcCFGExtender");

  if (ConfigFiles.Count > 0)
  {
    while (ConfigFiles.HasNext())
    {
      aFile = ConfigFiles.Next();
      Log.Message(aFile.Name + " file is located in " + ConfigPath);
    }
  }
  else
    Log.Message("No .tcCFGExtender files were found");
}

Python

def ProjectSuiteSample():
  # Obtains the path to the folder that stores the project suite configuration files
  ConfigPath = ProjectSuite.ConfigPath
  # Searches for the .tcCFGExtender files in the folder
  ConfigFiles = aqFileSystem.FindFiles(ConfigPath, "*.tcCFGExtender")
  if ConfigFiles.Count > 0:
    while ConfigFiles.HasNext():
      aFile = ConfigFiles.Next()
      Log.message(aFile.Name + " file is located in " + ConfigPath)
  else:
    Log.Message("No .tcCFGExtender files were found")

VBScript

Sub ProjectSuiteSample

  Dim ConfigPath, ConfigFiles, aFile

  ' Obtains the path to the folder that stores the project suite configuration files
  ConfigPath = ProjectSuite.ConfigPath
  ' Searches for the .tcCFGExtender files in the folder
  Set ConfigFiles = aqFileSystem.FindFiles(ConfigPath, "*.tcCFGExtender")

  If ConfigFiles.Count > 0 Then
    While ConfigFiles.HasNext
      Set aFile = ConfigFiles.Next
      Log.Message aFile.Name & " file is located in " & ConfigPath
    Wend
  Else
    Log.Message "No .tcCFGExtender files were found"
  End If

End Sub

DelphiScript

procedure ProjectSuiteSample();
var ConfigPath, ConfigFiles, aFile;

begin

  // Obtains the path to the folder that stores the project suite configuration files
  ConfigPath := ProjectSuite.ConfigPath;
  // Searches for the .tcCFGExtender files in the folder
  ConfigFiles := aqFileSystem.FindFiles(ConfigPath, '*.tcCFGExtender');

  if ConfigFiles.Count > 0 then
  begin
    while ConfigFiles.HasNext do
    begin
      aFile := ConfigFiles.Next;
      Log.Message(aFile.Name + ' file is located in ' + ConfigPath);
    end;
  end
  else
    Log.Message('No .tcCFGExtender files were found');
end;

C++Script, C#Script

function ProjectSuiteSample()
{

  var ConfigPath, ConfigFiles, aFile;

  // Obtains the path to the folder that stores the project suite configuration files
  ConfigPath = ProjectSuite["ConfigPath"];
  // Searches for the .tcCFGExtender files in the folder
  ConfigFiles = aqFileSystem["FindFiles"](ConfigPath, "*.tcCFGExtender");

  if (ConfigFiles.Count > 0)
  {
    while (ConfigFiles["HasNext"]())
    {
      aFile = ConfigFiles["Next"]();
      Log["Message"](aFile.Name + " file is located in " + ConfigPath);
    }
  }
  else
    Log["Message"]("No .tcCFGExtender files were found");
}

See Also

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

Highlight search results