XMLCheckpoint Object

Applies to TestComplete 15.69, last modified on November 13, 2024

Description

The XMLCheckpoint object provides a scripting interface to the XMLCheckpoint elements of the Stores | XML collection in your TestComplete project. Using these objects you can create XML and web service checkpoints and modify the element’s properties from scripts.

To obtain the XMLCheckpoint object in scripts, use properties of the XML object.

Note: The XMLCheckpoint object provides access to a copy of the element’s data. Changes made to the stored data via the object’s properties will not be stored to the element and will not be displayed in the XMLCheckpoint Element editor.

Members

Example

The following example demonstrates how you can obtain the XMLCheckpoint object in script.

JavaScript, JScript

function XMLCheckpointObjectDemo()
{

  var XMLCheckpoint;
  // Checks if MyXMLCheckpoint exists in the Stores | XML collection.
  if (XML.Contains("MyXMLCheckpoint") )
    // If MyXMLCheckpoint exists, obtains the corresponding XMLCheckpoint object from script.
    XMLCheckpoint = XML.MyXMLCheckpoint;
  else
    // If MyXMLCheckpoint does not exist, posts an error message to the log.
    Log.Error("Such a checkpoint does not exist.");

}

Python

def XMLCheckpointObjectDemo():
  # Checks if MyXMLCheckpoint exists in the Stores | XML collection.
  if XML.Contains("MyXMLCheckpoint"):
    # If MyXMLCheckpoint exists, obtains the corresponding XMLCheckpoint object from script. 
    XMLCheckpoint = XML.MyXMLCheckpoint
  else:
    # If MyXMLCheckpoint does not exist, posts an error message to the log. 
    Log.Error("Such a checkpoint does not exist.")

VBScript

Sub XMLCheckpointObjectDemo
Dim XMLCheckpoint

  ' Checks if MyXMLCheckpoint exists in the Stores | XML collection.
  If XML.Contains("MyXMLCheckpoint") Then
    ' If MyXMLCheckpoint exists, obtains the corresponding XMLCheckpoint object from script.
    Set XMLCheckpoint = XML.MyXMLCheckpoint
  Else
    ' If MyXMLCheckpoint does not exist, posts an error message to the log.
    Log.Error("Such a checkpoint does not exist.")
  End If

End Sub

DelphiScript

procedure XMLCheckpointObjectDemo();
var XMLCheckpoint;
begin

  // Checks if MyXMLCheckpoint exists in the Stores | XML collection.
  if XML.Contains('MyXMLCheckpoint') then
    // If MyXMLCheckpoint exists, obtains the corresponding XMLCheckpoint object from script.
    XMLCheckpoint := XML.MyXMLCheckpoint
  else
    // If MyXMLCheckpoint does not exist, posts an error message to the log.
    Log.Error('Such a checkpoint does not exist.');

end;

C++Script, C#Script

function XMLCheckpointObjectDemo()
{

  var XMLCheckpoint;
  // Checks if MyXMLCheckpoint exists in the Stores | XML collection.
  if (XML["Contains"]("MyXMLCheckpoint") )
    // If MyXMLCheckpoint exists, obtains the corresponding XMLCheckpoint object from script.
    XMLCheckpoint = XML["MyXMLCheckpoint"];
  else
    // If MyXMLCheckpoint does not exist, posts an error message to the log.
    Log["Error"]("Such a checkpoint does not exist.");

}

See Also

About XML Collection
About XML Checkpoints
XML Object
CreateXML Method

Highlight search results