Check Method

Applies to TestComplete 15.42, last modified on September 08, 2022

Description

Runs the audits the WebAuditsCheckpoint object includes and reports the results to the test log.

Declaration

WebAuditsCheckpointObj.Check()

WebAuditsCheckpointObj An expression, variable or parameter that specifies a reference to a WebAuditsCheckpoint object
Result Boolean

Applies To

The method is applied to the following object:

Result Value

True if the checkpoint has passed, that is, if all the audit scores are equal to or greater than the specified threshold values. Otherwise, False.

Example

The following example demonstrates how to use the method to run all the available audits:

JavaScript, JScript

function VerifyWebPage()
{
 var url = "http://services.smartbear.com/samples/TestComplete15/smartstore";
 WebAudits.For(url).Check();
}

Python

def VerifyWebPage():
  url = "http://services.smartbear.com/samples/TestComplete14/smartstore"
  WebAudits.For(url).Check()

VBScript

Sub VerifyWebPage
 url = "http://services.smartbear.com/samples/TestComplete15/smartstore"
 WebAudits.For(url).Check()
End Sub

DelphiScript

procedure VerifyWebPage();
var url;
begin
 url :='http://services.smartbear.com/samples/TestComplete15/smartstore';
 WebAudits.For(url).Check();
end;

C++Script, C#Script

function VerifyWebPage()
{
 var url = "http://services.smartbear.com/samples/TestComplete15/smartstore";
 WebAudits["For"](url)["Check"]();
}

The following example demonstrates how to use the method to run SEO and Accessibility audits:

JavaScript, JScript

function VerifyWebPage()
{
 var url = "http://services.smartbear.com/samples/TestComplete15/smartstore";
 var w = WebAudits.For(url);
 w.AddSEOAudits(70).AddAccessibilityAudits(60).Check();
}

Python

def VerifyWebPage():
  url = "http://services.smartbear.com/samples/TestComplete14/smartstore"
  w = WebAudits.For(url)
  w.AddSEOAudits(70).AddAccessibilityAudits(60).Check()

VBScript

Sub VerifyWebPage
 url = "http://services.smartbear.com/samples/TestComplete15/smartstore"
 Set w = WebAudits.For(url)
 w.AddSEOAudits(70).AddAccessibilityAudits(60).Check()
End Sub

DelphiScript

procedure VerifyWebPage();
var url, w;
begin
 url :='http://services.smartbear.com/samples/TestComplete15/smartstore';
 w := WebAudits.For(url);
 w.AddSEOAudits(70).AddAccessibilityAudits(60).Check();
end;

C++Script, C#Script

function VerifyWebPage()
{
 var url = "http://services.smartbear.com/samples/TestComplete15/smartstore";
 var w = WebAudits["For"](url);
 w["AddSEOAudits"](70)["AddAccessibilityAudits"](60)["Check"]();
}

See Also

WebAuditsCheckpoint Object
Web Audits Checkpoints

Highlight search results