To learn more about using JavaScript in LeanFT, see Setting up and working with the JavaScript SDK.
For JavaScript code samples, see Code Samples - JavaScript.

WebView

Mobile. WebView

new WebView(propsopt) → {WebView}

The description of a WebView test object in a mobile application.
Parameters:
Name Type Attributes Description
props Object <optional>
Initializes the description using the supplied property bag.
Returns:
the description object that was initialized.
Type
WebView

Methods

accessibilityId(idopt) → {string|Description}

The accessibility ID of the mobile object.
Parameters:
Name Type Attributes Description
id string <optional>
When provided, this method acts as a setter and sets the accessibilityId.
Returns:
If no parameter is provided, the method acts as a getter and returns the current stored accessibilityId; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

className(nameopt) → {string|Description}

The test object class name used by Mobile Center.
Parameters:
Name Type Attributes Description
name string <optional>
When provided, this method acts as a setter and sets the className.
Returns:
If no parameter is provided, the method acts as a getter and returns the current stored className; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

container(contopt) → {string|Description}

The container information if the object is in a table (iOS only).
Parameters:
Name Type Attributes Description
cont string <optional>
When provided, this method acts as a setter and sets the container.
Returns:
If no parameter is provided, the method acts as a getter and returns the current stored container; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

index(valueopt) → {Number|Description}

The 0-based index of this object, relative to all other objects with an otherwise identical description.
Parameters:
Name Type Attributes Description
value Number <optional>
When provided, this method acts as a setter and sets the index to the specified value.
Returns:
If no parameter is provided, the method acts as a getter and returns the current stored index; otherwise it returns 'this' for use with the builder pattern.
Type
Number | Description

mobileCenterIndex(indexopt) → {number|Description}

An ordinal number assigned to the object to indicate the order in which the object appears on the device relative to other objects with an otherwise identical description.
Parameters:
Name Type Attributes Description
index number <optional>
When provided, this method acts as a setter and sets the mobileCenterIndex.
Returns:
If no parameter is provided, the method acts as a getter and returns the current stored mobileCenterIndex; otherwise it returns 'this' for use with the builder pattern.
Type
number | Description

resourceId(idopt) → {string|Description}

The resource ID of the object. (Android only)
Parameters:
Name Type Attributes Description
id string <optional>
When provided, this method acts as a setter and sets the resourceId.
Returns:
If no parameter is provided, the method acts as a getter and returns the current stored resourceId; otherwise it returns 'this' for use with the builder pattern.
Type
string | Description

vri(valueopt, valueopt)

Sets a VisualRelation definition.
The VRI definition helps to distinguish this object from other objects with otherwise identical descriptions, based on this object's visual relationship to another object in the application.
Parameters:
Name Type Attributes Description
value Object <optional>
The object containing the VRI definition for this object.
Properties
Name Type Attributes Default Description
anchor Object The related test object.
horizontal Horizontal <optional>
The horizontal relation definition.
hInline bool <optional>
false The horizontal inline definition.
vertical Vertical <optional>
The vertical relation definition.
vInline string <optional>
false The vertical inline definition.
proximity Proximity <optional>
The proximity relation definition.
value Array <optional>
Array that contains multiple VRI definition for this object.