aqEnvironment Object

Applies to TestComplete 15.69, last modified on November 13, 2024

Description

The aqEnvironment object provides unified methods for obtaining information about the operating system, the TestComplete plugin set and for performing various environment-specific operations.

The object is available in TestComplete by default.

Note that it is possible to skip the object’s name (aqEnvironment) when calling its members in scripts. For example, the following two lines are equivalent:

JavaScript, JScript

isDDTAvailable = aqEnvironment.IsPluginInstalled("Data-Driven Testing");
isDDTAvailable = IsPluginInstalled("Data-Driven Testing");

Python

isDDTAvailable = aqEnvironment.IsPluginInstalled("Data-Driven Testing")
isDDTAvailable = IsPluginInstalled("Data-Driven Testing")

VBScript

isDDTAvailable = aqEnvironment.IsPluginInstalled("Data-Driven Testing")
isDDTAvailable = IsPluginInstalled("Data-Driven Testing")

DelphiScript

isDDTAvailable := aqEnvironment.IsPluginInstalled('Data-Driven Testing');
isDDTAvailable := IsPluginInstalled('Data-Driven Testing');

C++Script, C#Script

isDDTAvailable = aqEnvironment["IsPluginInstalled"]("Data-Driven Testing");
isDDTAvailable = IsPluginInstalled("Data-Driven Testing");

Members

Example

The following example demonstrates how you can use the aqEnvironment object to check whether the WMI Object extension is available in TestComplete:

JavaScript, JScript

function Test()
{
  if (aqEnvironment.IsScriptExtensionInstalled("WMI Object"))
    WMI.PostDrivesInfo();
  else
    Log.Error("The \"WMI Object\" script extension is not available.");
}

Python

def Test():
  if aqEnvironment.IsScriptExtensionInstalled("WMI Object"):
    WMI.PostDrivesInfo()
  else:
    Log.Error("The \"WMI Object\" script extension is not available.")

VBScript

Sub Test
  If aqEnvironment.IsScriptExtensionInstalled("WMI Object") Then
    WMI.PostDrivesInfo
  Else
    Log.Error "The ""WMI Object"" script extension is not available."
  End If
End Sub

DelphiScript

procedure Test;
begin
  if aqEnvironment.IsScriptExtensionInstalled('WMI Object') then
    WMI.PostDrivesInfo
  else
    Log.Error('The "WMI Object" script extension is not available.');
end;

C++Script, C#Script

function Test()
{
  if (aqEnvironment["IsScriptExtensionInstalled"]("WMI Object"))
    WMI["PostDrivesInfo"]();
  else
    Log["Error"]("The \"WMI Object\" script extension is not available.");
}

See Also

TestComplete Helper Objects
OSInfo Object
aqConvert Object
aqDateTime Object
aqFile Object
aqFileSystem Object
aqObject Object
aqString Object
aqUtils Object

Highlight search results