Object checkpoints are deprecated. We do not recommend using them. Use property checkpoints instead. |
Sometimes, object checkpoints fail because the object characteristics you are checking have been changed since the test was created.
TestComplete allows you to update object checkpoints:
-
During the test run.
-
From the test log after the test run is over.
The update replaces the expected property values specified in the checkpoint with the actual values found during the test run.
The rest of this topic describes both approaches in detail.
Updating Checkpoints During the Test Run
Updating Multiple Object Checkpoints
Updating Individual Checkpoints Using the Objects.Update Method
Updating Checkpoints During the Test Run
Updating Multiple Object Checkpoints
TestComplete lets you update the expected data of object checkpoints during the test run. This can be useful if you need to bulk update many object checkpoints with the actual data in your tested application.
Data update is supported for:
-
The Object Checkpoint keyword test operation.
-
The
Objects.CheckpointName.Check
scripting method. -
The
Objects.Compare
scripting method.
To enable checkpoint data update during the test run, do the following:
-
Turn on the global update option:
-
Select Tools | Options from the TestComplete main menu. This will open the Options dialog.
-
Select the Engines | Stores category.
-
Select Update objects.
-
Click OK to close the dialog.
-
-
Select the checkpoints to update:
-
In the Project Explorer, double-click the Stores | Objects item. This will open the Objects editor.
-
Select the Update check box next to the checkpoints you want to update during the test run.
-
Select File | Save from the TestComplete main menu to save the changes.
-
Now, when you run the test, the selected checkpoints will not perform property comparison. Instead, TestComplete will replace the expected property values in these checkpoints with the actual values found in the tested application.
After you update the needed checkpoints, remember to disable the global and per-checkpoint update options. |
Updating Individual Checkpoints Using the Objects.Update Method
You can update the data of individual checkpoints using the Objects.Update
method. This method works irregardless of the global Update objects option and per-checkpoint Update flags.
The method call looks as follows:
JavaScript, JScript
Objects.Update(AObject, Name);
Python
Objects.Update(AObject, Name)
VBScript
Call Objects.Update(AObject, Name)
DelphiScript
Objects.Update(AObject, Name);
C++Script, C#Script
Objects["Update"](AObject, Name);
It has the following parameters:
-
AObject - the object in the tested application that contains the data to update the checkpoint with.
-
Name - the checkpoint name.
Suppose you have the following checkpoint in your script:
JavaScript, JScript
Objects.wndNotepad.Check(Aliases.notepad.wndNotepad);
Python
Objects.wndNotepad.Check(Aliases.notepad.wndNotepad)
VBScript
Call Objects.wndNotepad.Check(Aliases.notepad.wndNotepad)
DelphiScript
Objects.wndNotepad.Check(Aliases.notepad.wndNotepad);
C++Script, C#Script
Objects["wndNotepad"]["Check"](Aliases["notepad"]["wndNotepad"]);
You can update the checkpoint data from the tested application using the following code:
JavaScript, JScript
Objects.Update(Aliases.notepad.wndNotepad, "wndNotepad");
Python
Objects.Update(Aliases.notepad.wndNotepad, "wndNotepad")
VBScript
Call Objects.Update(Aliases.notepad.wndNotepad, "wndNotepad")
DelphiScript
Objects.Update(Aliases.notepad.wndNotepad, 'wndNotepad');
C++Script, C#Script
Objects["Update"](Aliases["notepad"]["wndNotepad"], "wndNotepad");
To call the Objects.Update
method from keyword tests, use the Call Object Method or Run Code Snippet operation.
Updating Checkpoints From the Test Log
When an object checkpoint fails, you can easily update its data from the test log. To do this:
-
Select the checkpoint failure message in the test log.
-
Switch to the Details panel.
-
Click the Update the <Checkpoint_name> checkpoint link at the bottom of the panel.
-
TestComplete will display a message asking whether you want to update the checkpoint.
Click Yes in this message to close it and to update the baseline data used for the failed checkpoint. After that, TestComplete will replace the stored object with the corresponding object existing in the system.
If you click No, TestComplete will close the message without updating the checkpoint.