GetZoneSettingsByUrl Method

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

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

Declaration

IEZoneSettingsManagerObj.GetZoneSettingsByUrl(URL)

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

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

URL

Specifies the desired URL, the security zone’s settings that you would like to access.

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 smartbear.com URL.

JavaScript, JScript

function IEZoneDemo()
{
  // Obtains zone settings of Internet Explorer
  var ieOptions = Options.IEZoneSettings;
  // Obtains the settings for the "smartbear.com" zone
  var ZoneURL = "http://smartbear.com";
  var ZoneSet = ieOptions.GetZoneSettingsForUrl(ZoneURL);
  
  // ...
  // Performs test commands
  // ...
}

Python

def IEZoneDemo():

  # Obtains zone settings of Internet Explorer
  ieOptions = Options.IEZoneSettings
  # Obtains the settings for the "smartbear.com" zone
  ZoneURL = "http:\\smartbear.com"
  ZoneSet = ieOptions.GetZoneSettingsForUrl(ZoneURL)
  
  # ...
  # Performs test commands
  # ...

VBScript

Sub IEZoneDemo()

  ' Obtains zone settings of Internet Explorer
  Set ieOptions = Options.IEZoneSettings
  ' Obtains the settings for the "smartbear.com" zone
  ZoneURL = "http://smartbear.com"
  Set ZoneSet = ieOptions.GetZoneSettingsForUrl(ZoneURL)
  
  ' ...
  ' Performs test commands
  ' ...
  
End Sub

DelphiScript

function IEZoneDemo;
var ieOptions, ZoneURL, ZoneSet;
begin

  // Obtains zone settings of Internet Explorer
  ieOptions := Options.IEZoneSettings;
  // Obtains the settings for the "smartbear.com" zone
  ZoneURL := 'http://smartbear.com';
  ZoneSet := ieOptions.GetZoneSettingsForUrl(ZoneURL);
  
  // ...
  // 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 "smartbear.com" zone
  var ZoneURL = "http://smartbear.com";
  var ZoneSet = ieOptions["GetZoneSettingsForUrl"](ZoneURL);
  
  // ...
  // Performs test commands
  // ...
}

See Also

GetZoneSettingsById Method
IEZoneSettings Object

Highlight search results