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.

Application

Mobile. Application

new Application(propsopt) → {Application}

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

Methods

identifier(idopt) → {string|Description}

The application identifier string.
Parameters:
Name Type Attributes Description
id string <optional>
When provided, this method acts as a setter and sets the identifier value.
Returns:
If no parameter is provided, the method acts as a getter and returns the current stored identifier value; 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

isPackaged(packagedopt) → {bool|Description}

Indicates whether this application is packaged (instrumented) or not.
Parameters:
Name Type Attributes Description
packaged bool <optional>
When provided, this method acts as a setter and sets the isPackaged value.
Returns:
If no parameter is provided, the method acts as a getter and returns the current stored isPackaged value; otherwise it returns 'this' for use with the builder pattern.
Type
bool | Description

name(nameopt) → {string|Description}

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

version(versionopt) → {string|Description}

The application version.
Parameters:
Name Type Attributes Description
version string <optional>
When provided, this method acts as a setter and sets the version value.
Returns:
If no parameter is provided, the method acts as a getter and returns the current stored version value; 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.