aqEnvironment.IsScriptExtensionInstalled Method

Applies to TestComplete 15.63, last modified on April 23, 2024

Description

The aqEnvironment.IsScriptExtensionInstalled method checks whether a certain script extension is installed and enabled in TestComplete. The extension can be specified by its name and, optionally, vendor and version (you can learn all of this information from the Script Extensions dialog). The method returns a boolean value that indicates the check result - True if the specified extension is available in TestComplete and False otherwise.

Declaration

aqEnvironment.IsScriptExtensionInstalled(PluginName, PluginAuthor, PluginVersion)

PluginName [in]    Required    String    
PluginAuthor [in]    Optional    String Default value: Empty string   
PluginVersion [in]    Optional    String Default value: Empty string   
Result Boolean

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

PluginName

The name of the script extension. This value is displayed in the Name column of the Script Extensions dialog. This parameter is case-insensitive.

PluginAuthor

The name of the script extension’s vendor. This value is displayed in parentheses after the extension’s version in the Name column of the Script Extensions dialog.

The vendor name is case-insensitive. If it is omitted or equal to an empty string, TestComplete will perform a vendor-independent check.

PluginVersion

The version of the script extension. This value is displayed in parentheses after the extension’s name in the Name column of the Script Extensions dialog.

The version string is case-insensitive. If it is omitted or equal to an empty string, TestComplete will perform a version-independent check.

Result Value

True, if the specified script extension is installed and enabled in TestComplete. False, if the extension is not installed or disabled in the Script Extensions dialog.

Remarks

To check whether a certain plugin is installed in TestComplete, use the aqEnvironment.IsPluginInstalled method.

Example

The following code snippet checks if the WMI Object extension is available:

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

Script Extensions
Installing and Uninstalling Script Extensions
IsPluginInstalled Method

Highlight search results