Open topic with navigation

com.hp.lft.sdk.web

## Interface WebElement

- All Superinterfaces:
    Clickable, LocationInfoProvider, SupportDragAndDrop, SupportsNativeObject, TestObject, TestObjectDescriber, VisibleProvider, WaitUntilVisibleProvider, WebTestObject, WebTestObjectDescriber
  All Known Subinterfaces:
    Accordion, Area, AudioControl, Button, Button, Calendar, Carousel, CheckBox, CheckBox, DatePicker, DateTimeInput, Dialog, EditField, EditField, FacetFilter, FileField, Header, Image, Label, Link, ListBox, ListBox, Menu, Menu, Menubar, NavigationBar, NotificationBar, NumericField, Paginator, Password, RadioButton, RadioGroup, RadioGroup, RatingIndicator, RoadMap, RowRepeater, Slider, Table, Table, TabStrip, TabStrip, Tile, ToggleButton, ToolBar, TreeView, TreeView, VideoControl

      public interface WebElement
      extends TestObject, Clickable, WebTestObject, SupportDragAndDrop

  A basic Web element's description.

- - ### Method Summary

    Modifier and Type | Method and Description
    --- | ---
    `void` | `doubleClick()` Clicks on the object twice. If you are testing a web or hybrid application on a mobile device, this method is equivalent to performing a DoubleTap gesture.
    `void` | `doubleClick(WebDoubleClickArgs args)` Clicks on an object twice according to the specified behavior.
    `void` | `fireEvent(EventInfo eventInfo)` Triggers an event on the test object.
    `java.lang.String` | `getAccessibilityName()` Returns the element's AccessibilityName.
    `java.lang.String` | `getCSSSelector()` Returns the element's CSS Selector.
    `java.lang.String` | `getRole()` Returns the object's role property.
    `java.lang.String` | `getXPath()` Returns the element's XPath.
    `void` | `hoverTap()` When hover is supported, places the pointer on the object.
    `void` | `hoverTap(Location location)` When hover is supported, places the pointer on the object.
    `void` | `longPress()` Presses and holds the object.
    `void` | `longPress(WebLongPressArgs args)` Presses and holds the object according to the specified behavior.
    `void` | `pan(long deltaX, long deltaY)` Performs a pan gesture on the object.
    `void` | `pan(WebPanArgs args)` Performs a pan gesture on the object according to the specified behavior.
    `void` | `pinch(double scale)` Performs a pinch gesture on the object.
    `void` | `pinch(WebPinchArgs args)` Perform a pinch gesture on the object according to the specified behavior.
    `void` | `swipe(SwipeDirection direction)` Swipes the object in the specified direction.
    `void` | `swipe(WebSwipeArgs args)` Swipes the object according to the specified behavior.

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

      `click, click, click`

    - ### Methods inherited from interface com.hp.lft.sdk.web.WebTestObject

      `getAttribute, getAttributes, getClassName, getComputedStyle, getComputedStyles, getId, getInnerHTML, getInnerText, getName, getOuterHTML, getOuterText, getTagName, getTitle, isVisible`

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

      `getAbsoluteLocation, getLocation, getSize`

    - ### Methods inherited from interface com.hp.lft.sdk.web.WebTestObjectDescriber

      `describe, describe`

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

      `describe`

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

      `getNativeObject`

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

      `dragAndDropOn, dragAndDropOn`

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

      `waitUntilVisible, waitUntilVisible`

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

      `isVisible`

- - ### Method Detail

    - #### doubleClick

          void doubleClick()
                    throws GeneralLeanFtException

      Clicks on the object twice.
      If you are testing a web or hybrid application on a mobile device, this method is equivalent to performing a DoubleTap gesture.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### doubleClick

          void doubleClick(WebDoubleClickArgs args)
                    throws GeneralLeanFtException

      Clicks on an object twice according to the specified behavior. If you are testing a web or hybrid application on a mobile device, this method is equivalent to performing a DoubleTap gesture.
      Parameters:
        `args` - additional arguments for the DoubleClick method.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### hoverTap

          void hoverTap()
                 throws GeneralLeanFtException

      When hover is supported, places the pointer on the object. Otherwise, taps the object.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### hoverTap

          void hoverTap(Location location)
                 throws GeneralLeanFtException

      When hover is supported, places the pointer on the object. Otherwise, taps the object.
      Parameters:
        `location` - location over which to hover.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### fireEvent

          void fireEvent(EventInfo eventInfo)
                  throws GeneralLeanFtException

      Triggers an event on the test object.
      Note: Use the `EventInfoFactory` class to generate the eventInfo argument value.
      Parameters:
        `eventInfo` - the event info describing the event to trigger.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### longPress

          void longPress()
                  throws GeneralLeanFtException

      Presses and holds the object. This method is not supported in Internet Explorer.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### longPress

          void longPress(WebLongPressArgs args)
                  throws GeneralLeanFtException

      Presses and holds the object according to the specified behavior.
      Parameters:
        `args` - additional arguments for the LongPress operation.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### pan

          void pan(long deltaX,
                   long deltaY)
            throws GeneralLeanFtException

      Performs a pan gesture on the object.
      Parameters:
        `deltaX` - the distance moved on the x-axis
        `deltaY` - the distance moved on the y-axis
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### pan

          void pan(WebPanArgs args)
            throws GeneralLeanFtException

      Performs a pan gesture on the object according to the specified behavior.
      Parameters:
        `args` - additional arguments for the pan operation.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### pinch

          void pinch(double scale)
              throws GeneralLeanFtException

      Performs a pinch gesture on the object.
      Parameters:
        `scale` - the zoom scale resulting from the pinch gesture. This is the ratio between the distance between the fingers at the end of the pinch gesture to the distance between the fingers at the beginning of the pinch gesture.
        For example, if you were to touch a screen with your fingers 6 cm apart, and pinch until your fingers were 3 cm apart, the scale would be 0.5. Likewise, if your fingers were 3 cm apart, and you pinch until your fingers are 6 cm apart, the scale would be 2.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### pinch

          void pinch(WebPinchArgs args)
              throws GeneralLeanFtException

      Perform a pinch gesture on the object according to the specified behavior.
      Parameters:
        `args` - additional arguments for the pinch operation.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### swipe

          void swipe(SwipeDirection direction)
              throws GeneralLeanFtException

      Swipes the object in the specified direction. This method is not supported in Internet Explorer.
      Parameters:
        `direction` - the direction in which to swipe. Possible values: `SwipeDirection`
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### swipe

          void swipe(WebSwipeArgs args)
              throws GeneralLeanFtException

      Swipes the object according to the specified behavior.
      Parameters:
        `args` - additional arguments for the swipe operation. Possible values: `WebSwipeArgs`
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getXPath

          java.lang.String getXPath()
                             throws GeneralLeanFtException

      Returns the element's XPath.
      Returns:
        the element's XPath.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getAccessibilityName

          java.lang.String getAccessibilityName()
                                         throws GeneralLeanFtException

      Returns the element's AccessibilityName.
      Returns:
        the element's AccessibilityName.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getCSSSelector

          java.lang.String getCSSSelector()
                                   throws GeneralLeanFtException

      Returns the element's CSS Selector.
      Returns:
        the element's CSS Selector.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getRole

          java.lang.String getRole()
                            throws GeneralLeanFtException

      Returns the object's role property.
      Returns:
        the object's role property.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.