Interface TestObject

All Superinterfaces:
TestObjectDescriber
All Known Subinterfaces:
Accordion, AgGrid, AiObject, APOGrid, AppBar, Applet, Application, ApplicationSession, Area, AudioControl, Browser, Button, Button, Button, Button, Button, Button, Button, Button, Button, Button, Button, Calendar, Calendar, Calendar, Calendar, Calendar, Calendar, Calendar, Calendar, Calendar, Carousel, CheckBox, CheckBox, CheckBox, CheckBox, CheckBox, CheckBox, CheckBox, CheckBox, CheckBox, CheckBox, CheckBox, ComboBox, ComboBox, ComboBox, ComboBox, ComboBox, ComboBox, DatePicker, DateTimeInput, Device, Dialog, Dialog, Dialog, Document, DropDown, Edit, EditField, EditField, EditField, EditField, EditField, EditField, EditField, EditField, EditField, Editor, Editor, Editor, Editor, Element, ExpandBar, FacetFilter, Field, FileField, FlexFieldWindow, FormWindow, Frame, Grid, Grid, GridBase<T>, GridItem, Group, GuiSession, Header, Header, HeaderItem, Image, Image, Image, InsightObject, InternalFrame, Label, Label, Label, Label, Label, Link, Link, Link, Link, List, List, List, List, ListBox, ListBox, ListBox, ListBox, ListBox, ListItem, ListOfValues, ListView, ListView, ListView, LogonWindow, Menu, Menu, Menu, Menu, Menu, Menu, Menubar, Menubar, MenuBar, MenuItem, NavigationBar, NavigatorWindow, Notification, NotificationBar, NumericField, OKCode, Page, Paginator, Paginator, Pane, Password, PickList, ProgressBar, ProgressBar, PropertyGrid, RadioButton, RadioButton, RadioButton, RadioButton, RadioButton, RadioButton, RadioButton, RadioButton, RadioGroup, RadioGroup, RadioGroup, RadioGroup, RatingIndicator, RecyclerView, RoadMap, RowRepeater, Screen, ScrollBar, ScrollBar, ScrollBar, ScrollBar, ScrollBar, SemanticZoom, Separator, Slider, Slider, Slider, Slider, Slider, SpinBox, SpinBox, SpinBox, Spinner, SplitButton, Static, StatusBar, StatusBar, StatusBar, StatusBar, StatusBar, StatusBar, Stepper, Tab, TabControl, TabControl, TabControl, TabControl, TabControl, TabControl, TabItem, Table, Table, Table, Table, Table, Table, Table, Table, Table, Table, TableBase<T>, TabStrip, TabStrip, TabStrip, TabStrip, Text, TextScreen, Thumb, Tile, TitleBar, Toggle, ToggleButton, ToolBar, ToolBar, ToolBar, ToolBar, ToolBar, ToolBar, ToolBar, ToolBar, ToolTip, TopLevelObject, TreeView, TreeView, TreeView, TreeView, TreeView, TreeView, TreeView, TreeView, TreeView, TreeView, TreeViewItem, TreeViewTable, UiGrid, UiObject, UiObject, UiObject, UiObject, UiObject, UiObject, UiObject, UiObjectBase, VideoControl, View, WebElement, WebView, Window, Window, Window, Window, Window, Window, Window, Window

public interface TestObject extends TestObjectDescriber
Base interface for all test objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    callFTMethod(String methodName, Class<T> returnType, Object... arguments)
    Calls a method or property of an OpenText Functional Testing test object.
    void
    callFTMethod(String methodName, Object... arguments)
    Calls a method or property of an OpenText Functional Testing test object.
    boolean
    Checks whether this object exists in the AUT before the object synchronization timeout elapses.
    boolean
    exists(Integer timeout)
    Checks whether this object exists in the AUT before the specified timeout elapses.
    <TChild extends TestObject>
    TChild[]
    findChildren(Class<TChild> type, Description description)
    Returns all the child test objects that match the specified test object type and description filter.
    Returns a clone of the description for this test object (the test object must be obtained using the describe method, otherwise, this method returns null).
    Returns the object display name defined in the Application Model.
    Returns the parent test object of this test object (the child object must be obtained using the describe method, otherwise, this method returns null).
    Captures a bitmap of this test object and returns a RenderedImage of it.
    Returns all rectangular areas containing the specified text within this object.
    getTextLocations(String textToFind, Rectangle textArea)
    Returns all rectangular areas within the supplied rectangle that contain the specified text.
    Returns all visible text from this object.
    Returns all visible text within the supplied rectangle.
    void
    Highlights this object in the AUT.
    <TChild extends TestObject>
    int
    highlightMatches(Class<TChild> type, Description description)
    Highlights all children that match the the specified test object type and description filter.
    void
    Replaces this test object's description with the supplied description.
    void
    setDisplayName(String displayName)
    Sets the object display name defined in the Application Model.
    Checks whether a snapshot of this object contains an exact match of the supplied image.
    verifyImageExists(RenderedImage imageToFind, byte similarity)
    Checks whether a snapshot of this object contains the supplied image.

    When this method returns a false value, the step fails, but the failure does not throw an exception or cause the test to stop running.
    boolean
    Checks whether a snapshot of this object is identical to the supplied image.
    boolean
    verifyImageMatch(RenderedImage expectedImage, byte pixelTolerance)
    Checks whether a snapshot of this object and the supplied image are a match, given the specified pixel tolerance value.
    boolean
    verifyImageMatch(RenderedImage expectedImage, byte pixelTolerance, byte rgbTolerance)
    Checks whether a snapshot of this object and the supplied image are a match, given the specified pixel and RGB tolerance values.
    boolean
    verifyImageMatch(RenderedImage expectedImage, ImageMaskArea maskArea)
    Checks whether the defined mask areas within the object snapshot and the supplied image are identical.
    boolean
    verifyImageMatch(RenderedImage expectedImage, ImageMaskArea maskArea, byte pixelTolerance)
    Checks whether the defined mask areas within the object snapshot and the supplied image match, given the specified pixel tolerance values.
    boolean
    verifyImageMatch(RenderedImage expectedImage, ImageMaskArea maskArea, byte pixelTolerance, byte rgbTolerance)
    Checks whether the defined mask areas within the object snapshot and the supplied image match, given the specified pixel and RGB tolerance values.
    boolean
    Waits until this test object exists or the object synchronization timeout elapses.
    boolean
    waitUntilExists(int totalTimeOutInSeconds)
    Waits until this test object exists or until the specified timeout elapses.

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

    describe
  • Method Details

    • getParent

      TestObject getParent()
      Returns the parent test object of this test object (the child object must be obtained using the describe method, otherwise, this method returns null).
      Returns:
      the parent test object of this test object.
    • getDescription

      Description getDescription() throws GeneralLeanFtException
      Returns a clone of the description for this test object (the test object must be obtained using the describe method, otherwise, this method returns null). For example, if the test object is a WebElement, the Parent is the IFrame or IBrowser test object that contains it.
      Returns:
      a clone of the description that was used in order to describe the current test object instance.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • setDescription

      void setDescription(Description description) throws GeneralLeanFtException
      Replaces this test object's description with the supplied description.
      Parameters:
      description - the new Description for this test object. (A clone of the description is used.)
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • exists

      boolean exists() throws GeneralLeanFtException
      Checks whether this object exists in the AUT before the object synchronization timeout elapses.
      Returns:
      true if the object is found in the AUT before the timeout; false, otherwise.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • exists

      boolean exists(Integer timeout) throws GeneralLeanFtException
      Checks whether this object exists in the AUT before the specified timeout elapses. Wait only the specified amount of time in the timeout parameter.
      Parameters:
      timeout - the time (in seconds) to wait for this object before returning the true or false result.
      Returns:
      true if the object is found in the AUT before the specified timeout; false, otherwise.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • highlight

      void highlight() throws GeneralLeanFtException
      Highlights this object in the AUT. Tip: This may be useful when debugging a test.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • findChildren

      <TChild extends TestObject> TChild[] findChildren(Class<TChild> type, Description description) throws GeneralLeanFtException, CloneNotSupportedException
      Returns all the child test objects that match the specified test object type and description filter.
      For example, you can use this method to retrieve all Web buttons on a Page with type="submit".
      Type Parameters:
      TChild - the generic type of the child test object.
      Parameters:
      type - the test object interface type to find. To avoid limiting to a specific test object type, use TestObject.
      description - a description containing the set of properties and values that should be common to all objects that are returned.
      Returns:
      an array of child test objects.
      Throws:
      GeneralLeanFtException - if error occurs during execution
      CloneNotSupportedException - in case description.clone() fails.
    • highlightMatches

      <TChild extends TestObject> int highlightMatches(Class<TChild> type, Description description) throws GeneralLeanFtException, CloneNotSupportedException
      Highlights all children that match the the specified test object type and description filter.
      Type Parameters:
      TChild - the generic type of the child test object.
      Parameters:
      type - The test object interface type to highlight. To avoid limiting to a specific test object type, use TestObject.
      description - A description containing the set of properties and values that is common to all objects to be are highlighted.
      Returns:
      the number of object that match the provided description and were highlighted.
      Throws:
      GeneralLeanFtException - if error occurs during execution
      CloneNotSupportedException - in case description.clone() fails.
    • getSnapshot

      Captures a bitmap of this test object and returns a RenderedImage of it.
      Returns:
      a RenderedImage of the captured test object.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • getDisplayName

      String getDisplayName()
      Returns the object display name defined in the Application Model.
      Returns:
      the object display name.
    • setDisplayName

      void setDisplayName(String displayName)
      Sets the object display name defined in the Application Model.
      Parameters:
      displayName - the object display name.
    • getVisibleText

      String getVisibleText() throws GeneralLeanFtException
      Returns all visible text from this object.
      Returns:
      all visible text from this object.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • getVisibleText

      String getVisibleText(Rectangle textArea) throws GeneralLeanFtException
      Returns all visible text within the supplied rectangle.
      Parameters:
      textArea - an inner rectangle within this object.
      Returns:
      all visible text within the supplied rectangle.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • getTextLocations

      Rectangle[] getTextLocations(String textToFind) throws GeneralLeanFtException
      Returns all rectangular areas containing the specified text within this object.
      Parameters:
      textToFind - the text string to find.
      Returns:
      all rectangular areas containing the specified text within this object.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • getTextLocations

      Rectangle[] getTextLocations(String textToFind, Rectangle textArea) throws GeneralLeanFtException
      Returns all rectangular areas within the supplied rectangle that contain the specified text.
      Parameters:
      textToFind - the text string to find.
      textArea - an inner rectangle within this object.
      Returns:
      all rectangular areas within the supplied rectangle that contain the specified text.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • verifyImageExists

      Point verifyImageExists(RenderedImage imageToFind) throws GeneralLeanFtException
      Checks whether a snapshot of this object contains an exact match of the supplied image.
      When this method returns a false value, the step fails, but the failure does not throw an exception or cause the test to stop running.
      Parameters:
      imageToFind - the image to locate in the sourceImage
      Returns:
      the Point where the image was located, or null if it was not found.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • verifyImageExists

      Point verifyImageExists(RenderedImage imageToFind, byte similarity) throws GeneralLeanFtException
      Checks whether a snapshot of this object contains the supplied image.

      When this method returns a false value, the step fails, but the failure does not throw an exception or cause the test to stop running.
      Parameters:
      imageToFind - the image to look for within the test object's snapshot.
      similarity - the minimum similarity between the two images (as a percentage), above which the find is considered a match.
      Returns:
      the Point where the image was located, or null if it was not found.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • verifyImageMatch

      boolean verifyImageMatch(RenderedImage expectedImage) throws GeneralLeanFtException
      Checks whether a snapshot of this object is identical to the supplied image.
      When this method returns a false value, the step fails, but the failure does not throw an exception or cause the test to stop running.
      Parameters:
      expectedImage - the image to compare to the test object snapshot.
      Returns:
      true if the images are identical, else false.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • verifyImageMatch

      boolean verifyImageMatch(RenderedImage expectedImage, byte pixelTolerance) throws GeneralLeanFtException
      Checks whether a snapshot of this object and the supplied image are a match, given the specified pixel tolerance value.
      When this method returns a false value, the step fails, but the failure does not throw an exception or cause the test to stop running.
      Parameters:
      expectedImage - the image to compare to the test object snapshot.
      pixelTolerance - the percentage of pixels that can differ between the two images, and still be considered a match.
      Returns:
      true if the images match within the specified tolerance, else false.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • verifyImageMatch

      boolean verifyImageMatch(RenderedImage expectedImage, byte pixelTolerance, byte rgbTolerance) throws GeneralLeanFtException
      Checks whether a snapshot of this object and the supplied image are a match, given the specified pixel and RGB tolerance values.
      When this method returns a false value, the step fails, but the failure does not throw an exception or cause the test to stop running.
      Parameters:
      expectedImage - the image to compare to the test object snapshot.
      pixelTolerance - the percentage of pixels that can differ between the two images, and still be considered a match.
      rgbTolerance - the percent by which the RGB values of the pixels in the two images can differ, and still be considered a match.
      Returns:
      true if the images match within the specified tolerances, else false.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • verifyImageMatch

      boolean verifyImageMatch(RenderedImage expectedImage, ImageMaskArea maskArea) throws GeneralLeanFtException
      Checks whether the defined mask areas within the object snapshot and the supplied image are identical.
      When this method returns a false value, the step fails, but the failure does not throw an exception or cause the test to stop running.
      Parameters:
      expectedImage - the image to compare to the test object snapshot.
      maskArea - the mask area within the two images to use for the comparison.
      Returns:
      true if the mask areas within the images are identical and the two full images are the same size, else false.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • verifyImageMatch

      boolean verifyImageMatch(RenderedImage expectedImage, ImageMaskArea maskArea, byte pixelTolerance) throws GeneralLeanFtException
      Checks whether the defined mask areas within the object snapshot and the supplied image match, given the specified pixel tolerance values.
      When this method returns a false value, the step fails, but the failure does not throw an exception or cause the test to stop running.
      Parameters:
      expectedImage - the image to compare to the test object snapshot.
      maskArea - the mask area within the two images to use for the comparison.
      pixelTolerance - the percentage of pixels that can differ between the two images, and still be considered a match.
      Returns:
      true if the mask areas within the images match and the two full images are the same size, else false.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • verifyImageMatch

      boolean verifyImageMatch(RenderedImage expectedImage, ImageMaskArea maskArea, byte pixelTolerance, byte rgbTolerance) throws GeneralLeanFtException
      Checks whether the defined mask areas within the object snapshot and the supplied image match, given the specified pixel and RGB tolerance values.
      When this method returns a false value, the step fails, but the failure does not throw an exception or cause the test to stop running.
      Parameters:
      expectedImage - the image to compare to the test object snapshot.
      maskArea - the mask area within the two images to use for the comparison.
      pixelTolerance - the percentage of pixels that can differ between the two images, and still be considered a match.
      rgbTolerance - the percent by which the RGB values of the pixels in the two images can differ, and still be considered a match.
      Returns:
      true if the mask areas within the images match and the two full images are the same size, else false.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • waitUntilExists

      boolean waitUntilExists() throws GeneralLeanFtException
      Waits until this test object exists or the object synchronization timeout elapses.
      Returns:
      true if the object exists within the object synchronization timeout, otherwise false.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • waitUntilExists

      boolean waitUntilExists(int totalTimeOutInSeconds) throws GeneralLeanFtException
      Waits until this test object exists or until the specified timeout elapses.
      Parameters:
      totalTimeOutInSeconds - the time (in seconds) to wait until the test object exists.
      Returns:
      true if the object exists before the specified timeout, otherwise false.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • callFTMethod

      void callFTMethod(String methodName, Object... arguments) throws GeneralLeanFtException
      Calls a method or property of an OpenText Functional Testing test object.
      Parameters:
      methodName - the name of the method or property to call.
      arguments - additional arguments that are required for the method or property.
      Throws:
      GeneralLeanFtException - if error occurs during execution
    • callFTMethod

      <T> T callFTMethod(String methodName, Class<T> returnType, Object... arguments) throws GeneralLeanFtException
      Calls a method or property of an OpenText Functional Testing test object.
      Type Parameters:
      T - the return type.
      Parameters:
      methodName - the name of the method or property to call.
      returnType - the return type that the called method or property should return.
      arguments - additional arguments that are required for the method or property.
      Returns:
      an object of the return type specified.
      Throws:
      GeneralLeanFtException - if error occurs during execution