Parameterizing Object Checkpoints

Applies to TestComplete 15.69, last modified on November 13, 2024
Object checkpoints are deprecated. We do not recommend using them. Use property checkpoints instead.

Object checkpoints in TestComplete check actual properties of an object under test against the stored collection of expected values.

Object checkpoints take only one parameter - the object whose properties you want to verify.

If you want to re-use an object checkpoint in your test, for example, to check multiple objects against the same set of baseline data, you can replace the hard-coded object to be checked with the parameter that obtains the desired object before the checkpoint is called. In other words, you may want to parameterize your object checkpoint.

This topic provides information on how to parameterize your object checkpoints:

Note: If you want to verify properties of multiple objects that belong to the same parent, you can create an object checkpoint for their parent object and configure the checkpoint to verify the properties of child objects. To do this, on the Select Objects to Store page of the Object Checkpoint wizard, select the Store data of the selected object and its children option and specify the list of child objects and their properties you want to verify.

In keyword tests

To parameterize your object checkpoints in keyword tests, in the Operation Parameters dialog of the Object Checkpoint operation replace the hard-coded tested object to be verified with a keyword test parameter or with a keyword test, project or project suite variable containing the desired object.

The image below demonstrates two object checkpoints. One of them verifies a hard-coded object, the other one verifies an object specified by the keyword test parameter param1.

Parameterized Object Checkpoint Operation

In scripts

To parameterize your object checkpoint in a script test, replace the hard-coded object passed to the Objects.ObjectCheckpointName.Check method with a script routine parameter or with a script, project or project suite variable containing a reference to the desired object under test.

The following routine demonstrates two object checkpoints. One of them verifies a hard-coded object and the other one verifies an object that is passed via the param1 parameter of the script routine:

JavaScript, JScript

function Test(param1)
{
  …
  Objects.Props.Check(Aliases.SampleApp.MainForm.Edit);
  …
  Objects.Props.Check(param1);
  …
}

Python

def Test(param1):
  ...
  Objects.Props.Check(Aliases.SampleApp.MainForm.Edit)
  ...
  Objects.Props.Check(param1)
  ...

VBScript

Sub Test(param1)
  …
  Objects.Props.Check(Aliases.SampleApp.MainForm.Edit)
  …
  Objects.Props.Check(param1)
  …
End Sub

DelphiScript

procedure Test(param1);
begin
  …
  Objects.Props.Check(Aliases.SampleApp.MainForm.Edit);
  …
  Objects.Props.Check(param1);
  …
end;

C++Script, C#Script

function Test(param1)
{
  …
  Objects["Props"]["Check"](Aliases.SampleApp.MainForm.Edit);
  …
  Objects["Props"]["Check"](param1);
  …
}

See Also

Object Checkpoints
About Object Checkpoints
Parameterizing Tests

Highlight search results