Region Object

Applies to TestComplete 15.10, last modified on November 29, 2021

Description

The Region object provides a scripting interface to a particular Regions collection image from your scripts.

To address an individual image of the Regions collection, use the following notation: Regions.Region_Item, where Region_Item is the unique name of the image within the collection. You can view and change image names in the Name column of the Regions editor.

Requirements

The Region object is available only if your project contains the Stores project item with the Regions collection in it.

Members

Example

The following code compares two images stored in the Regions collection using the Region.Check method. To specify the images, we use their names in the collection.

JavaScript, JScript

function Test()
{
  if (! Regions.Image1Name.Check("Image2Name"))
    Log.Error("The compared regions are not identical.");
}

Python

def Test():
  if not Regions.Image1Name.Check("Image2Name"):
    Log.Error("The compared regions are not identical.")

VBScript

Sub Test
  If Not Regions.Image1Name.Check("Image2Name") Then
    Log.Error "The compared regions are not identical."
  End If
End Sub

DelphiScript

procedure Test;
begin
  if not Regions.Image1Name.Check('Image2Name') then
    Log.Error('The compared regions are not identical.');
end;

C++Script, C#Script

function Test()
{
  if (! Regions["Image1Name"]["Check"]("Image2Name"))
    Log["Error"]("The compared regions are not identical.");
}

See Also

Regions Object
About Regions Collection
About Region Checkpoints
Stores
Picture Object

Highlight search results