OnMobile Method

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

Configures the web audit checkpoint to run audits against a web page while emulating its behavior on a mobile device.

Note: A Nexus 5X mobile device will be emulated.

Declaration

WebAuditsCheckpointObj.OnMobile()

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

Applies To

The method is applied to the following object:

Result Value

A WebAuditsCheckpoint object configured to emulate a mobile device.

Example

The following example demonstrates how to run audits for a web page opened on a mobile device emulator:

JavaScript, JScript

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

Python

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

VBScript

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

DelphiScript

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

C++Script, C#Script

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

See Also

WebAuditsCheckpoint Object
Web Audits Checkpoints

Highlight search results