Check Method

Applies to TestComplete 15.45, last modified on December 01, 2022

Description

Use the Check method to perform verification actions specified by the properties of the WebAccessibility project element that corresponds to the WebAccessibility object. If all of the verifications pass, the method returns True and posts a success message to the test log. Otherwise, it returns False and, by default, posts the found differences to the log.

Declaration

WebAccessibilityObj.Check(PageObject, Timeout)

WebAccessibilityObj An expression, variable or parameter that specifies a reference to a WebAccessibility object
PageObject [in]    Optional    A Page object Default value: The Page object that is specified in the corresponding Web Accessibility project element   
Timeout [in]    Optional    Integer Default value: -1   
Result Boolean

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

PageObject

Specifies the Page object, over which verification operations will be performed. If this parameter is not specified, TestComplete uses the Page object that is specified in the corresponding Web Accessibility project element.

Timeout

The Timeout parameter is ignored. It is reserved for future implementation.

Result Value

If the contents of the tested web page match the specified verification settings, the method returns True and posts a checkpoint message ( ) to the test log. Otherwise, the method returns False and posts an error message ( ) to the log.

Remarks

The method verifies elements of the specified web page according to the properties of the appropriate Web Accessibility project element. For more information on these actions, see About Web Accessibility Checkpoints.

You can also use the Compare method to perform verification actions.

Example

The following code verifies the web page stored as the Web Accessibility project element.

JavaScript, JScript

function WebAccessibilityCheck()
{
  // Obtains the WebAccessibility object
  var WebObject = WebTesting.WebAccessibility1;

  // Checks the WebAccessibility object
  WebObject.Check();
}

Python

def WebAccessibilityCheck():
  # Obtains the WebAccessibility object
  WebObject = WebTesting.WebAccessibility1
  # Checks the WebAccessibility object
  WebObject.Check()

VBScript

Sub WebAccessibilityCheck
  Dim WebObject

  ' Obtains the WebAccessibility object
  Set WebObject = WebTesting.WebAccessibility1

  ' Checks the WebAccessibility object
  WebObject.Check
End Sub

DelphiScript

procedure WebAccessibilityCheck;
var WebObject;
begin
  // Obtains the WebAccessibility object
  WebObject := WebTesting.WebAccessibility1;

  // Checks the WebAccessibility object
  WebObject.Check;
end;

C++Script, C#Script

function WebAccessibilityCheck()
{
  // Obtains the WebAccessibility object
  var WebObject = WebTesting["WebAccessibility1"];

  // Checks the WebAccessibility object
  WebObject["Check"]();
}

See Also

About Web Accessibility Checkpoints
Compare Method

Highlight search results