RegionInfo Object

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

Description

The RegionInfo object corresponds to a rectangular area of the tested object and allows capturing the image of that area. To obtain the object in test, use the Regions.CreateRegionInfo method.

You can use the RegionInfo object for image comparison, for example, to compare an area of the tested object with a baseline image. For more information on image comparison, see About Region Checkpoints.

Members

Example

The following routine uses the RegionInfo object to compare a region of a tested window with a baseline image stored in the Stores | Regions project collection:

JavaScript, JScript

function Test()
{

  var wnd = Sys.Process("TestedApp").Window("Main", "*");
  // Specifies the rectangular area
  var reg = Regions.CreateRegionInfo(wnd, 0, 0, 100, 150, false);
  // Performs comparison
  Regions.wndMain.Check(reg);

}

Python

def Test():
  wnd = Sys.Process("TestedApp").Window("Main", "*")
  # Specifies the rectangular area 
  reg = Regions.CreateRegionInfo(wnd, 0, 0, 100, 150, False)
  # Performs comparison 
  Regions.wndMain.Check(reg)

VBScript

Sub Test

  Set wnd = Sys.Process("TestedApp").Window("Main", "*")
  ' Specifies the rectangular area
  Set reg = Regions.CreateRegionInfo(wnd, 0, 0, 100, 150, False)
  ' Performs comparison
  Regions.wndMain.Check(reg)

End Sub

DelphiScript

procedure Test;
var wnd, reg: OleVariant;
begin

  wnd := Sys.Process('TestedApp').Window('Main', '*');
  // Specifies the rectangular area
  reg := Regions.CreateRegionInfo(wnd, 0, 0, 100, 150, false);
  // Performs comparison
  Regions.wndMain.Check(reg);

end;

C++Script, C#Script

function Test()
{

  var wnd = Sys["Process"]("TestedApp")["Window"]("Main", "*");
  // Specifies the rectangular area
  var reg = Regions["CreateRegionInfo"](wnd, 0, 0, 100, 150, false);
  // Performs comparison
  Regions["wndMain"]["Check"](reg);

}

See Also

Regions Object
CreateRegionInfo Method
About Region Checkpoints
Alternatives to Region Checkpoints

Highlight search results