Open topic with navigation

com.hp.lft.sdk.web

## Interface Frame

- All Superinterfaces:
    LocationInfoProvider, SupportsNativeObject, TestObject, TestObjectDescriber, VisibleProvider, WaitUntilVisibleProvider, WebTestObject, WebTestObjectDescriber

      public interface Frame
      extends TestObject, WebTestObject

  A Web frame object that represents both the frame element in a frame set and an embedded frame that uses the frame element. The frame is a separate HTML document that is part of the test object hierarchy.

- - ### Method Summary

    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getText()` Returns the inner text of the body element.
    `java.lang.String` | `getURL()` Returns the URL of the frame.
    `java.lang.String` | `runJavaScript(java.lang.String scriptToRun)` Runs the given JavaScript code in the frame's context and returns the result.
    `<TResult> TResult` | `runJavaScript(java.lang.String scriptToRun, java.lang.Class<TResult> returnType)` Runs the given JavaScript text in the frame's context and returns the result cast to returnType.
    `void` | `sync()` Waits for the frame's state to be idle.

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

      `waitUntilVisible, waitUntilVisible`

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

      `isVisible`

- - ### Method Detail

    - #### getURL

          java.lang.String getURL()
                           throws GeneralLeanFtException

      Returns the URL of the frame.
      Returns:
        the URL of the frame.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getText

          java.lang.String getText()
                            throws GeneralLeanFtException

      Returns the inner text of the body element.
      Returns:
        the inner text of the body element.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### runJavaScript

          <TResult> TResult runJavaScript(java.lang.String scriptToRun,
                                          java.lang.Class<TResult> returnType)
                                   throws GeneralLeanFtException

      Runs the given JavaScript text in the frame's context and returns the result cast to returnType.
      Type Parameters:
        `TResult` - the generic type of return type.
      Parameters:
        `scriptToRun` - the JavaScript code to run.
        `returnType` - the type of return value.
      Returns:
        the numeric result of running the JavaScript code.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### runJavaScript

          java.lang.String runJavaScript(java.lang.String scriptToRun)
                                  throws GeneralLeanFtException

      Runs the given JavaScript code in the frame's context and returns the result.
      Parameters:
        `scriptToRun` - the JavaScript code to run.
      Returns:
        the result of running the JavaScript code as a string.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### sync

          void sync()
             throws GeneralLeanFtException

      Waits for the frame's state to be idle.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.