Interface Page

All Superinterfaces:
SupportsNativeObject, TestObject, TestObjectDescriber, WebTestObjectDescriber

An HTML page.
  • Method Details

    • getURL

      Returns the URL of the page.
      Returns:
      the URL of the page.
      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
    • getTitle

      String getTitle() throws GeneralLeanFtException
      Returns the page's title.
      Returns:
      the page's title.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • getAbsoluteLocation

      Point getAbsoluteLocation() throws GeneralLeanFtException
      Returns this object's absolute coordinates relative to the screen (in pixels).
      0,0 is always the top-left corner of the (primary) monitor.
      Returns:
      the object's absolute coordinates relative to the screen (in pixels).
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • getSize

      Returns the object's size (in pixels).
      Returns:
      the object's size (in pixels).
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • runJavaScript

      <TResult> TResult runJavaScript(String scriptToRun, Class<TResult> returnType) throws GeneralLeanFtException
      Runs the given JavaScript code in the page's context and returns the result cast to returnType.
      Type Parameters:
      TResult - the generic type of returntype.
      Parameters:
      scriptToRun - the JavaScript code to run.
      returnType - the type of return value.
      Returns:
      the numeric result of running the JavaScript.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • runJavaScript

      String runJavaScript(String scriptToRun) throws GeneralLeanFtException
      Runs the given JavaScript code in the page's context and returns the result.
      Parameters:
      scriptToRun - the JavaScript code to run.
      Returns:
      the string result of running the JavaScript.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • sync

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