HTML Table Checkpoints - Overview

HTML Table Checkpoint Extension

Select language for code samples HTML Table Checkpoints

HTML Table Checkpoints - Overview

This topic provides an overview of HTML Table checkpoints. It explains how these checkpoints work, describes the requirements and explains where you can find the code that implements the checkpoint’s functionality.

About the HTML Table Checkpoint

HTML Table checkpoints are used to compare HTML tables’ data with a baseline copy of data. The baseline copy is stored as an element of the Stores | XML collection of your test projects. These elements are created when you create these checkpoints. The current contents of the HTML table is stored in the stores project item and then used as a baseline copy.

The HTML Table Checkpoint script extension appends the HTMLTableCheckpoint object to TestComplete’s object model. This object contains the HTMLTableCheckpoint.Compare method that performs the comparison. It compare data of an HTML table with the stored baseline copy.

Requirements

HTML Table checkpoints are created with the script extensions technology. The toolbar items, dialogs and scripting objects that are used to create and work with HTML Table checkpoints are only available if the HTML Table Checkpoint extension is installed in TestComplete.

Creating the Checkpoint

You create the checkpoints with the Create HTML Table Checkpoint dialog. You may call it during test recording or at design time:

Create HTML Table Checkpoint dialog

In the dialog you specify the HTML table whose contents will be verified and the name of the project element, to which the table’s contents will be saved.

Upon closing the dialog, TestComplete displays the Copy Text to Clipboard dialog that displays the generated script code that performs the comparison. Here is an example of this code:

Show Example

Show ExampleHide Example

VBScriptCopy Code

If (Not  HTMLTableCheckpoint.Compare("MyHTMLTableCheckpoint", Sys.Process("iexplore").Page("http://www.automatedqa.com/").Table("MyTable"), True)) Then
  Call Log.Error("The MyHTMLTableCheckpoint failed")
End If

JScriptCopy Code

if (!HTMLTableCheckpoint.Compare("MyHTMLTableCheckpoint", Sys.Process("iexplore").Page("http://www.automatedqa.com/").Table("MyTable"), true))
  Log.Error("The MyHTMLTableCheckpoint failed");

DelphiScriptCopy Code

if not HTMLTableCheckpoint.Compare('MyHTMLTableCheckpoint', Sys.Process('iexplore').Page('http://www.automatedqa.com/').Table('MyTable'), true) then
  Log.Error('The MyHTMLTableCheckpoint failed');

C++Script, C#ScriptCopy Code

if (! HTMLTableCheckpoint["Compare"]("MyHTMLTableCheckpoint", Sys["Process"]("iexplore")["Page"]("http://www.automatedqa.com/")["Table"]("MyTable"), true))
  Log["Error"]("The MyHTMLTableCheckpoint failed");

For detailed information on inserting the checkpoint into script code, see Creating HTML Table Checkpoints in Scripts.

The HTML Table Checkpoint extension does not provide a keyword test operation that allows you to use the checkpoint from keyword tests. So, to use the checkpoint functionality from keyword tests, use the operations that will call the HTMLTableCheckpoint.Compare method from keyword tests. For instance, you can use the Run Code Snippet or Call Object Method operations. For more information about this, see HTML Table Checkpoints in Keyword Tests.

Checkpoint’s Source Code

The HTMLTableCheckpoint.tcx file includes the checkpoint’s source code. This file is a ZIP archive that has the .tcx extension. So, you can use any zip archive utility to unpack the files from it. For information about the extension’s files, see HTML Table Checkpoint Extension Files.

See also
Creating HTML Table Checkpoints in Scripts | HTML Table Checkpoints in Keyword Tests | HTMLTableCheckpoint Object

© 2009 AutomatedQA Corp.
Send feedback on this topic