Open topic with navigation

com.hp.lft.sdk.mobile

## Class UiObjectBaseDescription

- java.lang.Object
- - com.hp.lft.sdk.internal.PropertiesDescriptionBase
  - - com.hp.lft.sdk.PropertiesDescription
    - - com.hp.lft.sdk.mobile.UiObjectBaseDescription

- All Implemented Interfaces:
    CloneableObject, Description, com.hp.lft.sdk.internal.DescriptionWithVri, Cloneable
  Direct Known Subclasses:
    ButtonDescription, CalendarDescription, CheckBoxDescription, DropDownDescription, EditFieldDescription, LabelDescription, PaginatorDescription, RadioGroupDescription, RecyclerViewDescription, SliderDescription, StepperDescription, TableDescription, TabStripDescription, ToggleDescription, UiObjectDescription, ViewDescription, WebViewDescription

      public class UiObjectBaseDescription
      extends PropertiesDescription
      implements com.hp.lft.sdk.internal.DescriptionWithVri

  The base description of all test objects in a mobile application.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `UiObjectBaseDescription.Init<T extends UiObjectBaseDescription.Init<T>>` Helper class for derived Builder classes.

  - ### Field Summary

    - ### Fields inherited from class com.hp.lft.sdk.internal.PropertiesDescriptionBase

      `properties`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `UiObjectBaseDescription()` Constructs a new instance of UiObjectDescriptionBase.
    `protected` | `UiObjectBaseDescription(UiObjectBaseDescription.Init<?> init)` Initializes a new instance of the UiObjectBaseDescription class using the Builder pattern.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `cloneTo(Object clonedObject)` Creates an exact copy of the test object with its description.
    `StringProperty` | `getAccessibilityId()` Returns the accessibility ID of the mobile object.
    `String` | `getClassName()` Returns the test object class name used by Mobile Center.
    `String` | `getContainer()` Returns the table container,if the object is in a table.
    `Integer` | `getMobileCenterIndex()` Returns the 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.
    `StringProperty` | `getNativeClass()` Returns the native class of the mobile control.
    `StringProperty` | `getResourceId()` Returns the resource ID of the object.
    `StringProperty` | `getText()` Returns text of the mobile object.
    `List<VisualRelation>` | `getVRI()` Returns the VisualRelation definition.
    `Boolean` | `isCheckable()` Indicates whether the mobile object can be checked.
    `Boolean` | `isChecked()` Indicates whether the mobile object is checked.
    `Boolean` | `isClickable()` Indicates whether the control can be tapped.
    `Boolean` | `isEnabled()` Indicates whether the object is enabled.
    `Boolean` | `isFocusable()` Indicates whether the control can receive focus.
    `Boolean` | `isFocused()` Indicates whether the mobile control is in focus.
    `void` | `setAccessibilityId(String accessibilityId)` Sets the accessibility ID of the mobile object.
    `void` | `setAccessibilityId(StringProperty accessibilityId)` Sets the accessibility ID of the mobile object.
    `void` | `setCheckable(Boolean isCheckable)` Sets whether the mobile object can be checked.
    `void` | `setChecked(Boolean isChecked)` Sets whether the mobile object is checked.
    `void` | `setClassName(String className)` Sets the test object class name used by Mobile Center.
    `void` | `setClickable(Boolean isClickable)` Sets whether the control can be tapped.
    `void` | `setContainer(String container)` Sets the table container, if the object is in a table.
    `void` | `setEnabled(Boolean isEnabled)` Sets whether the object is enabled.
    `void` | `setFocusable(Boolean isFocusable)` Sets whether the control can receive focus.
    `void` | `setFocused(Boolean isFocused)` Sets whether the mobile control is in focus.
    `void` | `setMobileCenterIndex(Integer mobileCenterIndex)` Sets the 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.
    `void` | `setNativeClass(String nativeClass)` Sets the native class of the mobile control.
    `void` | `setNativeClass(StringProperty nativeClass)` Sets the native class of the mobile control.
    `void` | `setResourceId(String resourceId)` Sets the resource ID of the object.
    `void` | `setResourceId(StringProperty resourceId)` Sets the resource ID of the object.
    `void` | `setText(String text)` Sets text of the mobile object.
    `void` | `setText(StringProperty text)` Sets text of the mobile object.
    `void` | `setVRI(List<VisualRelation> visualRelations)` Sets a VisualRelation definition.
    `void` | `setVRI(VisualRelation... vriRelations)` Sets a VisualRelation definition.

    - ### Methods inherited from class com.hp.lft.sdk.PropertiesDescription

      `clone`

    - ### Methods inherited from class com.hp.lft.sdk.internal.PropertiesDescriptionBase

      `getValueAs, getValueAsStringProperty, insertValue`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.hp.lft.sdk.CloneableObject

      `clone`

- - ### Constructor Detail

    - #### UiObjectBaseDescription

          public UiObjectBaseDescription()

      Constructs a new instance of UiObjectDescriptionBase.

    - #### UiObjectBaseDescription

          protected UiObjectBaseDescription(UiObjectBaseDescription.Init<?> init)

      Initializes a new instance of the UiObjectBaseDescription class using the Builder pattern.
      Parameters:
        `init` - the Builder pattern.

  - ### Method Detail

    - #### setAccessibilityId

          public void setAccessibilityId(String accessibilityId)

      Sets the accessibility ID of the mobile object.
      Parameters:
        `accessibilityId` - the accessibility ID of the mobile object.

    - #### setAccessibilityId

          public void setAccessibilityId(StringProperty accessibilityId)

      Sets the accessibility ID of the mobile object.
      Parameters:
        `accessibilityId` - a StringProperty (or RegExpProperty) representing the accessibility ID of the mobile object.

    - #### getAccessibilityId

          public StringProperty getAccessibilityId()

      Returns the accessibility ID of the mobile object.
      Returns:
        the accessibility ID of the mobile object.

    - #### setClassName

          public void setClassName(String className)

      Sets the test object class name used by Mobile Center.
      Parameters:
        `className` - the test object class name used by Mobile Center.

    - #### getClassName

          public String getClassName()

      Returns the test object class name used by Mobile Center.
      Returns:
        the test object class name used by Mobile Center.

    - #### setContainer

          public void setContainer(String container)

      Sets the table container, if the object is in a table. (iOS Only)
      Parameters:
        `container` - the table container. (iOS Only)

    - #### getContainer

          public String getContainer()

      Returns the table container,if the object is in a table. (iOS Only)
      Returns:
        the table container.

    - #### setResourceId

          public void setResourceId(String resourceId)

      Sets the resource ID of the object. (Android Only)
      Parameters:
        `resourceId` - the resource ID of the object. (Android Only)

    - #### setResourceId

          public void setResourceId(StringProperty resourceId)

      Sets the resource ID of the object. (Android Only)
      Parameters:
        `resourceId` - a StringProperty (or RegExpProperty) representing the resource ID of the object. (Android Only)

    - #### getResourceId

          public StringProperty getResourceId()

      Returns the resource ID of the object. (Android Only)
      Returns:
        the resource ID of the object. (Android Only)

    - #### setMobileCenterIndex

          public void setMobileCenterIndex(Integer mobileCenterIndex)

      Sets the 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:
        `mobileCenterIndex` - the ordinal number assigned to the object.

    - #### getMobileCenterIndex

          public Integer getMobileCenterIndex()

      Returns the 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.
      Returns:
        the ordinal number assigned to the object.

    - #### getVRI

          public List<VisualRelation> getVRI()

      Returns the 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.
      Specified by:
        `getVRI` in interface `com.hp.lft.sdk.internal.DescriptionWithVri`
      Returns:
        a `VisualRelation` object containing the VRI definition for this object.

    - #### setVRI

          public void setVRI(List<VisualRelation> visualRelations)

      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.
      Specified by:
        `setVRI` in interface `com.hp.lft.sdk.internal.DescriptionWithVri`
      Parameters:
        `visualRelations` - the `VisualRelation` object containing the VRI definition for this object.

    - #### setVRI

          public void setVRI(VisualRelation... vriRelations)

      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.
      Specified by:
        `setVRI` in interface `com.hp.lft.sdk.internal.DescriptionWithVri`
      Parameters:
        `vriRelations` - the `VisualRelation` object containing the VRI definition for this object.

    - #### setNativeClass

          public void setNativeClass(String nativeClass)

      Sets the native class of the mobile control.
      Parameters:
        `nativeClass` - the native class of the mobile control.

    - #### setNativeClass

          public void setNativeClass(StringProperty nativeClass)

      Sets the native class of the mobile control.
      Parameters:
        `nativeClass` - a `StringProperty` or `RegExpProperty` representing the native class of the mobile control.

    - #### getNativeClass

          public StringProperty getNativeClass()

      Returns the native class of the mobile control.
      Returns:
        the native class of the mobile control.

    - #### setEnabled

          public void setEnabled(Boolean isEnabled)

      Sets whether the object is enabled.
      Parameters:
        `isEnabled` - true if enabled.

    - #### isEnabled

          public Boolean isEnabled()

      Indicates whether the object is enabled.
      Returns:
        true if enabled.

    - #### setClickable

          public void setClickable(Boolean isClickable)

      Sets whether the control can be tapped.
      Parameters:
        `isClickable` - true if has the control can be tapped.

    - #### isClickable

          public Boolean isClickable()

      Indicates whether the control can be tapped.
      Returns:
        true if has the control can be tapped.

    - #### setFocusable

          public void setFocusable(Boolean isFocusable)

      Sets whether the control can receive focus.
      Parameters:
        `isFocusable` - true if has the control can receive focus.

    - #### isFocusable

          public Boolean isFocusable()

      Indicates whether the control can receive focus.
      Returns:
        true if has the control can receive focus.

    - #### setFocused

          public void setFocused(Boolean isFocused)

      Sets whether the mobile control is in focus.
      Parameters:
        `isFocused` - true if has the mobile control is in focus.

    - #### isFocused

          public Boolean isFocused()

      Indicates whether the mobile control is in focus.
      Returns:
        true if has the mobile control is in focus.

    - #### cloneTo

          protected void cloneTo(Object clonedObject)
                          throws CloneNotSupportedException

      Creates an exact copy of the test object with its description.
      Overrides:
        `cloneTo` in class `com.hp.lft.sdk.internal.PropertiesDescriptionBase`
      Throws:
        `CloneNotSupportedException`

    - #### setText

          public void setText(String text)

      Sets text of the mobile object.
      Parameters:
        `text` - the text of the mobile object.

    - #### setText

          public void setText(StringProperty text)

      Sets text of the mobile object.
      Parameters:
        `text` - a StringProperty (or RegExpProperty) representing text of the mobile object.

    - #### getText

          public StringProperty getText()

      Returns text of the mobile object.
      Returns:
        text of the mobile object.

    - #### setCheckable

          public void setCheckable(Boolean isCheckable)

      Sets whether the mobile object can be checked.
      Parameters:
        `isCheckable` - true if the mobile object can be checked.

    - #### isCheckable

          public Boolean isCheckable()

      Indicates whether the mobile object can be checked.
      Returns:
        true if the object can be checked.

    - #### setChecked

          public void setChecked(Boolean isChecked)

      Sets whether the mobile object is checked. (Relevant for objects that can have a check mark.)
      Parameters:
        `isChecked` - true to mark the mobile object as checked.

    - #### isChecked

          public Boolean isChecked()

      Indicates whether the mobile object is checked.
      Returns:
        true if the mobile object is checked.