com.rational.test.ft.domain.html

Class ImageProxy

  • All Implemented Interfaces:
    com.ibm.rational.test.ft.clearscript.IClearscript, IHtmlGraphicalSubitem, com.rational.test.ft.domain.IChannelObject, com.rational.test.ft.domain.IDataDriven, com.rational.test.ft.domain.IGetInterestingRecogProsForDynFind, com.rational.test.ft.domain.IHtmlCustomDomainEnablement, com.rational.test.ft.domain.IInternalObjectStatus, com.rational.test.ft.domain.IProxyBase, com.rational.test.ft.domain.IQuickFind, com.rational.test.ft.domain.IXPathFind, com.rational.test.ft.object.interfaces.IGraphical, com.rational.test.ft.object.interfaces.IGraphicalSubitem


    public class ImageProxy
    extends ElementProxy
    implements com.rational.test.ft.object.interfaces.IGraphicalSubitem, IHtmlGraphicalSubitem, com.ibm.rational.test.ft.clearscript.IClearscript
    Implements the proxy for HTML IMG elements. This includes client-side and server-side image maps.
    • TestObject Interface: StatelessGuiSubitemTestObject

    • Supported Test Data Types:
      TypeDesciption
      text Visible Text ITestDataText

    • Default Recognition Properties:
      • .alt
      • .class
      • .classIndex
      • .id
      • .name
      • .src
      • .title

    • Supported Subitems:
      SubitemUsage
      AreaArea

    • Supported Canonical Properties:
      PropertyUsage
      .alignThis is the value of the align attribute of the element.  Valid values are bottom, middle, and top.
      .alt The value of the alt attribute an element.  This is the "alternate" text  for the element, frequently displayed by the browser when the mouse hovers over the element.
      .border This is the value of the border attribute of the element. Returns the number of pixels.
      .bounds A rectangle representing the bounding rectangle of the object in screen coordinates.
      .class This is the  test object class name, for example "HtmlTable" for a <Table> element.
      .className This the value of the class attribute of an element
      .hasScript This value is returned as a boolean.  If true then script as been associated with actions on this element.
      .height The value of the height attribute of an element.  For an Image element this is the display height  in pixels for the image.
      .hspace The value of the hspace attribute of an element, the amount of whitespace inserted to the left or right of an IMG, OBJECT, or APPLET.
      .id This is the value of the id attribute of an element.
      .isMap The value of the isMap attribute of an element returned as a boolean.  For Image elements (IMG) if this is TRUE then this indicates a server side image map.
      .name This is the value of the name attribute (Form elements and Frames only)
      .offsetHeight The height of the element.
      .offsetLeft The offset of the element from its offset parent in the DOM.
      .offsetTop The offset of the element from its offset parent in the DOM.
      .offsetWidth The width  of the element.
      .screenLeft Upper left corner of bounding rectangle in screen coordinates, x component.
      .screenTop Upper left corner of bounding rectangle in screen coordinates, y component.
      .src This is the value of the src attribute for the element. For images and image buttons this is a URL specifying the desired image file.
      .tag This is the Html tag for the element
      .text This is the text inside of the HTML tags for bounding the element.  For example, <A>This is an Anchor<IMG src=map.gif></a>   the text property will return "This is an Anchor.   All white space are combined and reduced to a single a blank character if consecutive white space characters are found.
      .title This is the value of the title attribute of an element.  This is frequently the text displayed when hovering over the element with the mouse.
      .useMap The value of the usemap attribute of an element.  The value is a string specifying a URL and is used for Image elements (IMG) to indicate a client side image map.  The URL points to the map associated MAP.  Frequently, this is a document relative reference.
      .vspace The value of the vspace attribute of an element, the amount of whitespace inserted to the above or below of an IMG, OBJECT, or APPLET.
      .width The value of the width attribute of an element.  For an Image element this is the display width in pixels for the image.

    Since:
    RFT1.0
    • Method Detail

      • getTestObjectClassName

        public java.lang.String getTestObjectClassName()
        Description copied from class: HtmlProxy
        The default GUI marshaller is returned. More specific marshallers are returned by more constrained proxy classes. This level of support is always required.
        Specified by:
        getTestObjectClassName in interface com.rational.test.ft.domain.IProxyBase
        Overrides:
        getTestObjectClassName in class HtmlGuiProxy
        Returns:
        The default mashaller class full name.
      • getDescriptiveName

        public java.lang.String getDescriptiveName()
        Description copied from class: HtmlProxy
        Returns a name that can be used to describe the associated UI object in a script. This name may be further adjusted to be made unique to the script, but will act as the base for the name used in the script. Only characters used in Html identifiers should be returned (alphabetic, numeric or underscore characters). Non-identifier characters will cause script compilation failures. An example of what to return may be "OKButton" for a Html.BUTTON with the text "OK" on it.
        Overrides:
        getDescriptiveName in class HtmlProxy
        Returns:
        A descriptive object name.
      • getRole

        public java.lang.String getRole()
        Returns TestObjectRole.ROLE_HTML.
        Overrides:
        getRole in class HtmlProxy
        Returns:
        A brief type name that describes the role this object plays in the UI.
        Since:
        RFT1.0
      • getChildAtPoint

        public java.lang.Object getChildAtPoint(java.awt.Point pt)
        All children of IMG elements are subitems, so this method always returns null.
        Specified by:
        getChildAtPoint in interface com.rational.test.ft.object.interfaces.IGraphical
        Overrides:
        getChildAtPoint in class HtmlGuiProxy
        Parameters:
        pt - Screen relative point to check.
        Returns:
        The object at the point or null if no child object is found.
        See Also:
        HtmlGuiProxy.getScreenRectangle()
      • isPointInObject

        public boolean isPointInObject(java.awt.Point point)
        Specified by:
        isPointInObject in interface com.rational.test.ft.object.interfaces.IGraphical
        Overrides:
        isPointInObject in class HtmlGuiProxy
      • getScreenRectangle

        public java.awt.Rectangle getScreenRectangle(com.rational.test.ft.script.Subitem subitem)
        Specified by:
        getScreenRectangle in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • getScreenPoint

        public java.awt.Point getScreenPoint(com.rational.test.ft.script.Subitem subitem)
        Specified by:
        getScreenPoint in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • getScreenPoint

        public java.awt.Point getScreenPoint(com.rational.test.ft.script.Subitem subitem,
                                             java.awt.Point pt)
        Specified by:
        getScreenPoint in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • getSubitem

        public java.lang.Object getSubitem(com.rational.test.ft.script.Subitem subitem)
        Returns an object that represents the specified subitem in the associated test object. SubitemNotFoundException will be thrown if the specified subitem is invalid relative to the associated test object. null may be returned if the subitem does not have an object association that can be returned.
        Specified by:
        getSubitem in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
        Parameters:
        subitem - The subitem to fetch an object for.
        Returns:
        An object representation of the subitem.
      • click

        public void click(com.rational.test.ft.script.Subitem subitem)
        Specified by:
        click in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • click

        public void click(com.rational.test.ft.script.MouseModifiers modifiers,
                          com.rational.test.ft.script.Subitem subitem)
        Specified by:
        click in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • click

        public void click(com.rational.test.ft.script.Subitem subitem,
                          java.awt.Point pt)
        Specified by:
        click in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • click

        public void click(com.rational.test.ft.script.MouseModifiers modifiers,
                          com.rational.test.ft.script.Subitem subitem,
                          java.awt.Point pt)
        Specified by:
        click in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • doubleClick

        public void doubleClick(com.rational.test.ft.script.Subitem subitem)
        Specified by:
        doubleClick in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • doubleClick

        public void doubleClick(com.rational.test.ft.script.MouseModifiers modifiers,
                                com.rational.test.ft.script.Subitem subitem)
        Specified by:
        doubleClick in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • doubleClick

        public void doubleClick(com.rational.test.ft.script.Subitem subitem,
                                java.awt.Point pt)
        Specified by:
        doubleClick in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • doubleClick

        public void doubleClick(com.rational.test.ft.script.MouseModifiers modifiers,
                                com.rational.test.ft.script.Subitem subitem,
                                java.awt.Point pt)
        Specified by:
        doubleClick in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • nClick

        public void nClick(int clickCount,
                           com.rational.test.ft.script.MouseModifiers modifiers,
                           com.rational.test.ft.script.Subitem subitem,
                           java.awt.Point pt)
        Specified by:
        nClick in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • drag

        public void drag(com.rational.test.ft.script.Subitem subitem)
        Specified by:
        drag in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • drag

        public void drag(com.rational.test.ft.script.MouseModifiers modifiers,
                         com.rational.test.ft.script.Subitem subitem)
        Specified by:
        drag in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • drag

        public void drag(com.rational.test.ft.script.Subitem subitem1,
                         com.rational.test.ft.script.Subitem subitem2)
        Specified by:
        drag in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • drag

        public void drag(com.rational.test.ft.script.MouseModifiers modifiers,
                         com.rational.test.ft.script.Subitem subitem1,
                         com.rational.test.ft.script.Subitem subitem2)
        Specified by:
        drag in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • drag

        public void drag(com.rational.test.ft.script.Subitem subitem1,
                         java.awt.Point pt1,
                         com.rational.test.ft.script.Subitem subitem2,
                         java.awt.Point pt2)
        Specified by:
        drag in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • drag

        public void drag(com.rational.test.ft.script.MouseModifiers modifiers,
                         com.rational.test.ft.script.Subitem subitem1,
                         java.awt.Point pt1,
                         com.rational.test.ft.script.Subitem subitem2,
                         java.awt.Point pt2)
        Specified by:
        drag in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • nClickDrag

        public void nClickDrag(int clickCount,
                               com.rational.test.ft.script.MouseModifiers modifiers,
                               com.rational.test.ft.script.Subitem subitem1,
                               com.rational.test.ft.script.Subitem subitem2)
        Specified by:
        nClickDrag in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • nClickDrag

        public void nClickDrag(int clickCount,
                               com.rational.test.ft.script.MouseModifiers modifiers,
                               com.rational.test.ft.script.Subitem subitem1,
                               java.awt.Point pt1,
                               com.rational.test.ft.script.Subitem subitem2,
                               java.awt.Point pt2)
        Specified by:
        nClickDrag in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • dragToScreenPoint

        public void dragToScreenPoint(com.rational.test.ft.script.Subitem subitem,
                                      java.awt.Point screenPt)
        Specified by:
        dragToScreenPoint in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • dragToScreenPoint

        public void dragToScreenPoint(com.rational.test.ft.script.MouseModifiers modifiers,
                                      com.rational.test.ft.script.Subitem subitem,
                                      java.awt.Point screenPt)
        Specified by:
        dragToScreenPoint in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • dragToScreenPoint

        public void dragToScreenPoint(com.rational.test.ft.script.Subitem subitem,
                                      java.awt.Point subitemPt,
                                      java.awt.Point screenPt)
        Specified by:
        dragToScreenPoint in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • dragToScreenPoint

        public void dragToScreenPoint(com.rational.test.ft.script.MouseModifiers modifiers,
                                      com.rational.test.ft.script.Subitem subitem,
                                      java.awt.Point subitemPt,
                                      java.awt.Point screenPt)
        Specified by:
        dragToScreenPoint in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • nClickDragToScreenPoint

        public void nClickDragToScreenPoint(int clickCount,
                                            com.rational.test.ft.script.MouseModifiers modifiers,
                                            com.rational.test.ft.script.Subitem subitem,
                                            java.awt.Point screenPt)
        Specified by:
        nClickDragToScreenPoint in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • nClickDragToScreenPoint

        public void nClickDragToScreenPoint(int clickCount,
                                            com.rational.test.ft.script.MouseModifiers modifiers,
                                            com.rational.test.ft.script.Subitem subitem,
                                            java.awt.Point subitemPt,
                                            java.awt.Point screenPt)
        Specified by:
        nClickDragToScreenPoint in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • mouseMove

        public void mouseMove(com.rational.test.ft.script.Subitem subitem)
        Specified by:
        mouseMove in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • mouseMove

        public void mouseMove(com.rational.test.ft.script.Subitem subitem,
                              java.awt.Point subitemPt)
        Specified by:
        mouseMove in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • mouseMove

        public void mouseMove(com.rational.test.ft.script.MouseModifiers modifiers,
                              com.rational.test.ft.script.Subitem subitem)
        Specified by:
        mouseMove in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • mouseMove

        public void mouseMove(com.rational.test.ft.script.MouseModifiers modifiers,
                              com.rational.test.ft.script.Subitem subitem,
                              java.awt.Point pt)
        Specified by:
        mouseMove in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • hover

        public void hover(double secondDelay,
                          com.rational.test.ft.script.Subitem subitem)
        Specified by:
        hover in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • hover

        public void hover(double secondDelay,
                          com.rational.test.ft.script.Subitem subitem,
                          java.awt.Point pt)
        Specified by:
        hover in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • hover

        public void hover(com.rational.test.ft.script.Subitem subitem)
        Specified by:
        hover in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • hover

        public void hover(com.rational.test.ft.script.Subitem subitem,
                          java.awt.Point pt)
        Specified by:
        hover in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
      • getSubobject

        public HtmlGuiProxy getSubobject(com.rational.test.ft.script.Subitem subitem)
        Description copied from interface: IHtmlGraphicalSubitem
        Returns the subobject specified by the subitem
        Specified by:
        getSubobject in interface IHtmlGraphicalSubitem
        Parameters:
        subitem - The subitem which identifies the subobject to be returned.
      • getScreenRectangle

        public java.awt.Rectangle getScreenRectangle(HtmlGuiProxy subObject)
        Description copied from interface: IHtmlGraphicalSubitem
        Returns the rectangle that contains the component being evaluated relative to the top left corner of the screen. This will commonly be two operations: (getScreenRectangle for the parent object, and then adjusting for the specified subitem) combined into a single operation. The rectangle is exposed so that actions may be directly scripted against a visible subitem. null is returned if the subitem is not showing.
        Specified by:
        getScreenRectangle in interface IHtmlGraphicalSubitem
      • isMap

        public boolean isMap()
      • getArea

        protected SubobjectProxy getArea(com.rational.test.ft.script.Subitem subitem)
      • getArea

        protected SubobjectProxy getArea(java.awt.Point screenPoint)
      • isClientSide

        protected boolean isClientSide()
      • getActionArgs

        protected java.util.Vector getActionArgs(java.awt.Point point)
        Override of getActionArgs in base class to provide the subitem action data requested inside the base class implementation of processMouseEvent.
        Overrides:
        getActionArgs in class HtmlGuiProxy
        Parameters:
        point - point in screen coordinates
        Returns:
        a vector containing the appropriate subitem arguments.
      • getMapName

        public java.lang.String getMapName()
      • getClearscriptSimpleName

        public java.lang.String getClearscriptSimpleName()
        Specified by:
        getClearscriptSimpleName in interface com.ibm.rational.test.ft.clearscript.IClearscript