WebTesting Object

Applies to TestComplete 15.31, last modified on March 17, 2022

Description

The WebTesting object provides a scripting interface to the elements of the Stores | WebTesting collection in your project.

The names of the object properties coincide with the names of the collections elements (the properties have the same name as the element names displayed in the Project Explorer panel). Each property returns the WebAccessibility or WebComparison object that corresponds to the appropriate child element.

Using methods of these objects you can compare the data of stored elements with web pages. For more information, see Web Accessibility Checkpoints and Web Comparison Checkpoints.

Requirements

The WebTesting object is available only if the Web Checkpoints plugin is installed in TestComplete and the project contains the Stores | WebTesting collection.

Members

Example

The following example demonstrates how you can use the WebTesting object to obtain and compare elements of the Stores | WebTesting collection.

JavaScript, JScript

function WebCompare()
{
  var WebAcc1, WebAcc2;

  // Uses the appropriate property of the WebTesting, …
  // … to obtain the WebAccessibility1 object in script.
  WebAcc1 = WebTesting.WebAccessibility1;

  // Uses the appropriate property of the WebTesting, …
  // … to obtain the WebAccessibility2 object in script.
  WebAcc2 = WebTesting.WebAccessibility2;

  // Compares the contents of the Web Accessibility checkpoints.
  WebAcc1.Compare(WebAcc2);

}

Python

def WebCompare():
  # Uses the appropriate property of the WebTesting, ... 
  # ... to obtain the WebAccessibility1 object in script.
  WebAcc1 = WebTesting.WebAccessibility1
  # Uses the appropriate property of the WebTesting, ...
  # ... to obtain the WebAccessibility2 object in script. 
  WebAcc2 = WebTesting.WebAccessibility2
  # Compares the contents of the Web Accessibility checkpoints. 
  WebAcc1.Compare(WebAcc2)

VBScript

Sub WebCompare
  Dim WebAcc1, WebAcc2

  ' Uses the appropriate property of the WebTesting, …
  ' … to obtain the WebAccessibility1 object in script.
  Set WebAcc1 = WebTesting.WebAccessibility1

  ' Uses the appropriate property of the WebTesting, …
  ' … to obtain the WebAccessibility2 object in script.
  Set WebAcc2 = WebTesting.WebAccessibility2

  ' Compares the contents of the Web Accessibility checkpoints.
  WebAcc1.Compare(WebAcc2)

End Sub

DelphiScript

procedure WebCompare();
var WebAcc1, WebAcc2;

begin
  // Uses the appropriate property of the WebTesting, …
  // … to obtain the WebAccessibility1 object in script.
  WebAcc1 := WebTesting.WebAccessibility1;

  // Uses the appropriate property of the WebTesting, …
  // … to obtain the WebAccessibility2 object in script.
  WebAcc2 := WebTesting.WebAccessibility2;

  // Compares the contents of the Web Accessibility checkpoints.
  WebAcc1.Compare(WebAcc2);

end;

C++Script, C#Script

function WebCompare()
{
  var WebAcc1, WebAcc2;

  // Uses the appropriate property of the WebTesting, …
  // … to obtain the WebAccessibility1 object in script.
  WebAcc1 = WebTesting["WebAccessibility1"];

  // Uses the appropriate property of the WebTesting, …
  // … to obtain the WebAccessibility2 object in script.
  WebAcc2 = WebTesting["WebAccessibility2"];

  // Compares the contents of the Web Accessibility checkpoints.
  WebAcc1["Compare"] (WebAcc2);

}

See Also

About Web Accessibility Checkpoints
About Web Comparison Checkpoints
WebAccessibility Object
WebComparison Object

Highlight search results