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 Details

    • getURL

      Returns the URL of the frame.
      Returns:
      the URL of the frame.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • getText

      String getText() throws GeneralLeanFtException
      Returns the inner text of the body element.
      Returns:
      the inner text of the body element.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • runJavaScript

      <TResult> TResult runJavaScript(String scriptToRun, 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 error occurs during execution
    • runJavaScript

      String runJavaScript(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 error occurs during execution
    • sync

      void sync() throws GeneralLeanFtException
      Waits for the frame's state to be idle.
      Throws:
      GeneralLeanFtException - if error occurs during execution