Share this page

# View

# Mobile. View

## new View(propsopt ) → {View}

The description of a view 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
  View

### 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 UFT Mobile.

##### 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

## isCheckable(stateopt ) → {boolean|Description}

Indicates whether the mobile object can be checked.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`state` | boolean | <optional> | When provided, this method acts as a setter and sets the isCheckable value.

##### Returns:

If no parameter is provided, the method acts as a getter and returns the current stored isCheckable value; otherwise it returns 'this' for use with the builder pattern.

Type
  boolean | Description

## isChecked(stateopt ) → {boolean|Description}

Indicates whether the mobile object is checked. (Relevant for objects that can have a check mark.)

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`state` | boolean | <optional> | When provided, this method acts as a setter and sets the isChecked value.

##### Returns:

If no parameter is provided, the method acts as a getter and returns the current stored isChecked value; otherwise it returns 'this' for use with the builder pattern.

Type
  boolean | Description

## isClickable(isClickableopt ) → {boolean|Description}

Indicates whether the mobile object can be tapped.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`isClickable` | boolean | <optional> | When provided, this method acts as a setter and sets the isClickable value.

##### Returns:

If no parameter is provided, the method acts as a getter and returns the current stored isClickable value; otherwise it returns 'this' for use with the builder pattern.

Type
  boolean | Description

## isEnabled(stateopt ) → {boolean|Description}

Indicates whether the mobile object can be enabled.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`state` | boolean | <optional> | When provided, this method acts as a setter and sets the isEnabled value.

##### Returns:

If no parameter is provided, the method acts as a getter and returns the current stored isEnabled value; otherwise it returns 'this' for use with the builder pattern.

Type
  boolean | Description

## isFocusable(stateopt ) → {boolean|Description}

Indicates whether the object can receive focus.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`state` | boolean | <optional> | When provided, this method acts as a setter and sets the isFocusable value.

##### Returns:

If no parameter is provided, the method acts as a getter and returns the current stored isFocusable value; otherwise it returns 'this' for use with the builder pattern.

Type
  boolean | Description

## isFocused(stateopt ) → {boolean|Description}

Indicates whether the mobile object is in focus.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`state` | boolean | <optional> | When provided, this method acts as a setter and sets the isFocused value.

##### Returns:

If no parameter is provided, the method acts as a getter and returns the current stored isFocused value; otherwise it returns 'this' for use with the builder pattern.

Type
  boolean | Description

## isScrollable(isScrollableopt ) → {boolean|Description}

Indicates whether the view can be scrolled.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`isScrollable` | boolean | <optional> | When provided, this method acts as a setter and sets the isScrollable value.

##### Returns:

If no parameter is provided, the method acts as a getter and returns the current stored isScrollable value; otherwise it returns 'this' for use with the builder pattern.

Type
  boolean | 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

## nativeClass(nativeClassopt ) → {string|Description}

The native class of the mobile object.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`nativeClass` | string | <optional> | When provided, this method acts as a setter and sets the nativeClass.

##### Returns:

If no parameter is provided, the method acts as a getter and returns the current stored nativeClass; otherwise it returns 'this' for use with the builder pattern.

Type
  string | 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

## text(textopt ) → {string|Description}

The object's text.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`text` | string | <optional> | When provided, this method acts as a setter and sets the text value.

##### Returns:

If no parameter is provided, the method acts as a getter and returns the current stored text value; otherwise it returns 'this' for use with the builder pattern.

Type
  string | Description

## vri(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` | Array.<Object> | <optional> | Array that contains multiple VRI definitions for this test object. ###### Properties
Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`anchor` | Object |  |  | The related test object.
`horizontal` | Horizontal | <optional> |  | The horizontal relation definition.
`hInline` | boolean | <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.

Tips to improve your search results... UFT Developer JavaScript SDK Reference Version 15.0-15.0.2 UFT Developer SDK Reference All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: