GetZoneSettingsById Method

Applies to TestComplete 15.10, last modified on December 15, 2021

Description

Use the GetZoneSettingsById method of the IEZoneSettingsManagerObj object to obtain scripting access to security settings of the specified security zone.

Declaration

IEZoneSettingsManagerObj.GetZoneSettingsById(Id)

IEZoneSettingsManagerObj An expression, variable or parameter that specifies a reference to an IEZoneSettingsManager object
Id [in]    Required    Integer    
Result The IEZoneSettings object

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

Id

Specifies the identifier of the desired zone. You can use one of the following constants to specify the parameter value:

Constant Security Zone
0 My Computer
1 Local Intranet Zone
2 Trusted Sites Zone
3 Internet Zone
4 Restricted Sites Zone

Result Value

The IEZoneSettings object that provides access to settings of the specified security zone.

Example

The code below obtains Internet Explorer's settings for the My Computer zone.

JavaScript, JScript

function IEZoneDemo()
{
  // Obtains zone settings of Internet Explorer
  var ieOptions = Options.IEZoneSettings;
  // Obtains the settings for the "MyComputer" zone
  var MyCompZoneID = 0;
  var ZoneSet = ieOptions.GetZoneSettingsById(MyCompZoneID);
  
  // ...
  // Performs test commands
  // ...
}

Python

def IEZoneDemo():

  # Obtains zone settings of Internet Explorer
  ieOptions = Options.IEZoneSettings
  # Obtains the settings for the "MyComputer" zone
  MyCompZoneID = 0
  ZoneSet = ieOptions.GetZoneSettingsById(MyCompZoneID)
  
  # ...
  # Performs test commands
  # ...

VBScript

Sub IEZoneDemo()

  ' Obtains zone settings of Internet Explorer
  Set ieOptions = Options.IEZoneSettings
  ' Obtains the settings for the "MyComputer" zone
  MyCompZoneID = 0
  Set ZoneSet = ieOptions.GetZoneSettingsById(MyCompZoneID)
  
  ' ...
  ' Performs test commands
  ' ...
  
End Sub

DelphiScript

function IEZoneDemo();
var ieOptions, MyCompZoneID, ZoneSet;
begin

  // Obtains zone settings of Internet Explorer
  ieOptions := Options.IEZoneSettings;
  // Obtains the settings for the "MyComputer" zone
  MyCompZoneID := 0;
  ZoneSet := ieOptions.GetZoneSettingsById(MyCompZoneID);
  
  // ...
  // Performs test commands
  // ...

end;

C++Script, C#Script

function IEZoneDemo()
{
  // Obtains zone settings of Internet Explorer
  var ieOptions = Options["IEZoneSettings"];
  // Obtains the settings for the "MyComputer" zone
  var MyCompZoneID = 0;
  var ZoneSet = ieOptions["GetZoneSettingsById"](MyCompZoneID);
  
  // ...
  // Performs test commands
  // ...
}

See Also

GetZoneSettingsByUrl Method
IEZoneSettings Object

Highlight search results