Open topic with navigation

com.hp.lft.sdk.mobile

## Interface Toggle

- All Superinterfaces:
    EnabledProvider, TestObject, TestObjectDescriber, UiObjectBase, WaitUntilEnabledProvider

      public interface Toggle
      extends UiObjectBase, TestObject

  A toggle object in a mobile application.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `set(boolean state)` Sets the state of the object.
    `void` | `set(String state)` Sets the state of the object by name.

    - ### Methods inherited from interface com.hp.lft.sdk.mobile.UiObjectBase

      `getAccessibilityId, getClassName, getContainer, getHint, getLocation, getMobileCenterIndex, getNativeClass, getResourceId, getSize, getText, isCheckable, isChecked, isClickable, isFocusable, isFocused, longPress, longPress, pan, pan, pan, pinch, pinch, swipe, swipe, tap, tap`

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

      `waitUntilEnabled, waitUntilEnabled`

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

      `isEnabled`

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

      `exists, exists, findChildren, getDescription, getDisplayName, getParent, getSnapshot, getTextLocations, getTextLocations, getVisibleText, getVisibleText, highlight, highlightMatches, setDescription, setDisplayName, verifyImageExists, verifyImageExists, verifyImageMatch, verifyImageMatch, verifyImageMatch, verifyImageMatch, verifyImageMatch, verifyImageMatch, waitUntilExists, waitUntilExists`

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

      `describe`

- - ### Method Detail

    - #### set

          void set(boolean state)
                   throws GeneralLeanFtException

      Sets the state of the object. For Android toggles (where ClassName="toggleButton"), use set(String) giving the state to set as the parameter.
      Parameters:
        `state` - sets whether this toggle will be checked.
      Throws:
        `GeneralLeanFtException` - if error occurs during execution

    - #### set

          void set(String state)
                   throws GeneralLeanFtException

      Sets the state of the object by name.
      Parameters:
        `state` - possible values: the states defined in the toggle object.
      Throws:
        `GeneralLeanFtException` - if error occurs during execution