com.rational.test.ft.domain.html

Class TableProxy

  • 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 TableProxy
    extends ElementProxy
    implements com.rational.test.ft.object.interfaces.IGraphicalSubitem, IHtmlGraphicalSubitem, com.ibm.rational.test.ft.clearscript.IClearscript
    Implements the Proxy for HTML TABLE elements.
    • TestObject Interface: StatelessGuiSubitemTestObject

    • Supported Test Data Types:
      TypeDesciption
      text Visible Text ITestDataText
      grid Data Grid ITestDataTable
      contents Table Contents ITestDataTable

    • Default Recognition Properties:
      • .caption
      • .class
      • .classIndex
      • .id
      • .title

    • Supported Subitems:
      SubitemUsage
      CellCell

    • Supported Canonical Properties:
      PropertyUsage
      .bounds A rectangle representing the bounding rectangle of the object in screen coordinates.
      .caption For TABLE elements is the the value of the caption  attribute.  For an Html dialog this is the text of the dialog's caption.
      .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.
      .id This is the value of the id attribute of an element.
      .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.
      .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.
      .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

      • shouldBeMapped

        public boolean shouldBeMapped()
        Description copied from class: ElementProxy
        Always returns true, because all HTML GUI objects are interesting.
        Overrides:
        shouldBeMapped in class ElementProxy
        Returns:
        false
      • 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()
        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_TABLE.
        Overrides:
        getRole in class HtmlProxy
        Returns:
        A brief type name that describes the role this object plays in the UI.
        Since:
        RFT1.0
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface com.rational.test.ft.object.interfaces.IGraphical
        Overrides:
        isEnabled 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)
        Returns a screen relative point on the supplied subitem. The point returned is guaranteed (by a hit test) for use to sucessfully click on the subitem.
        Specified by:
        getScreenPoint in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
        Parameters:
        subitem - The subitem the resultant screen point is relative to.
        Returns:
        A screen relative point.
      • 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
      • processMouseEvent

        public void processMouseEvent(com.rational.test.ft.domain.IMouseActionInfo action)
        Return a MethodSpecification for the specified mouse event. This is the primary record interface for mouse events against a particular control.
        Overrides:
        processMouseEvent in class HtmlGuiProxy
        Parameters:
        action - The event cache and other mouse state information for this mouse action.
        See Also:
        MethodSpecification, HtmlGuiProxy.getActionArgs(java.awt.Point)
      • processPreDownMouseEvent

        protected void processPreDownMouseEvent(com.rational.test.ft.domain.IMouseActionInfo action)
        This method is called to process a mouse event in the IMouseActionInfo.PRE_DOWN event state. On PRE_DOWN we have enough information to build only a "click" method specification. This method specification may be overriden by one generated by handling the PRE_UP event. Note: For efficiency, the Cell subitems may have already been constructed while handling previous PRE_DOWN or PRE_UP event states.
        Overrides:
        processPreDownMouseEvent in class HtmlGuiProxy
      • processPreUpMouseEvent

        protected void processPreUpMouseEvent(com.rational.test.ft.domain.IMouseActionInfo action,
                                              int clicks,
                                              boolean isDrag)
        This method is called to process a mouse event, IMouseActionInfo.PRE_UP event state On PRE_UP build a new method specification which will override the one recorded on the PRE_DOWN. Note: For efficiency, the Subitems may have already been constructed while handling previous PRE_DOWN or PRE_UP event states.
        Overrides:
        processPreUpMouseEvent in class HtmlGuiProxy
      • isSameCell

        protected boolean isSameCell(com.rational.test.ft.script.Cell c1,
                                     com.rational.test.ft.script.Cell c2)
      • setMethodSpecification

        protected void setMethodSpecification(com.rational.test.ft.domain.IMouseActionInfo action,
                                              java.lang.String method,
                                              java.util.Vector args)
        Overrides:
        setMethodSpecification in class HtmlGuiProxy
      • getActionArgs

        protected java.util.Vector getActionArgs(java.awt.Point point)
        Description copied from class: HtmlGuiProxy
        Generate the action argument for the screen point. This method is called by the processMouseEvent implementation in this class. Subclasses should override this and substitute the corresponding ISubItem object(s). The default implementation generates a java.awt.Point which is relative to the upper left of the object as the single argument.
        Overrides:
        getActionArgs in class HtmlGuiProxy
        Parameters:
        point - point in screen coordinates
        Returns:
        a vector containing the appropriate subitem arguments.
      • getDataCell

        public TableDataCellProxy getDataCell(java.awt.Point pt)
        Returns a TableDataCellProxy object (proxy for TH and TD HTML elements) at the specified screen point.
        Parameters:
        pt - The screen point as which to look for a TH or TD element.
        Returns:
        Returns a TableDataCellProxy object, or null if not found
      • getDataCellInRowGroup

        protected TableDataCellProxy getDataCellInRowGroup(HtmlGuiProxy parent,
                                                           java.awt.Point pt)
        Returns a TableDataCellProxy object (proxy for TH and TD HTML table cell elements) at the specified screen point, within a THEAD, TFOOT, or TBODY element.
        Parameters:
        parent - The Parent object of the TableDataCellProxy object.
        pt - The screen point as which to look for a TH or TD element.
        Returns:
        Returns a TableDataCellProxy object
      • getDataCell

        public TableDataCellProxy getDataCell(com.rational.test.ft.script.Subitem subitem)
        Get the TableDataCellProxy object (proxy for TH and TD HTML table cell elements) identified by the Subitem. If the subitem is not found it throws an com.rational.test.ft.SubitemNotFoundException.
        Parameters:
        subitem - Subclass of Subitem which identifies a specific cell in the table.
        Returns:
        Returns the TableDataCellProxy object, which is identified by the Subitem, if not found throws exception.
      • addHeader

        public boolean addHeader(TableDataCellProxy dataCell,
                                 boolean isForColHeader)
        Adds a header to the headerList (maintained by this object)
        Parameters:
        headerText - Visible text of the header.
        centerPoint - Center point of the bounds of the TH cell
        Returns:
        boolean Returns true if the header was successfully added to the header list.
      • getRowHeader

        public java.lang.String getRowHeader(java.awt.Point dataCellCenterPt)
        Returns the visible text of the row header for the given dataCell.
        Parameters:
        dataCellCenterPt - Center point of the data cell (identifies the data cell)
        Returns:
        Row header String, or null if not found.
      • getColumnHeader

        public java.lang.String getColumnHeader(java.awt.Point dataCellCenterPt)
        Returns the visible text of the column header for the given dataCell.
        Parameters:
        dataCellCenterPt - Center point of the data cell (identifies the data cell)
        Returns:
        Column header String, or null if not found.
      • initHeaderList

        protected void initHeaderList()
      • getTestDataTypes

        public java.util.Hashtable getTestDataTypes()
        Returns a hashtable of data type descriptions of the verification point data available with the associated object in the SUT. The hashtable keys are String objects that are used as the VP type in the associated test data. The type is a simple value that is defferent then other type values associated with this object under test. The type keys map to a verbose description of the test data, reasonable for presentation to a user.
        Overrides:
        getTestDataTypes in class HtmlProxy
        Returns:
        An hashtable of type/description pairs used to describe the verification data available from this proxy.
        See Also:
        getTestData(String), ITestData
      • getTestData

        public com.rational.test.ft.vp.ITestData getTestData(java.lang.String testDataType)
        This method constructs the specified verification data object. The testDataType parameter is one of the hashtable keys returned by getTestDataTypes.
        Overrides:
        getTestData in class HtmlProxy
        Parameters:
        testDataType - A test data type supplied by getTestDataTypes.
        Returns:
        The verification data for the supplied type.
        See Also:
        getTestDataTypes(), ITestData
      • updateTestData

        public com.rational.test.ft.vp.ITestData updateTestData(java.lang.String testDataType,
                                                                com.rational.test.ft.vp.ITestData testData)
        This method updates the supplied test data object and returns it. The testDataType parameter is one of the hashtable keys returned by getTestDataTypes. The testData is a previously supplied ITestData object that needs to be updated to reflect the current state of the associated test object.
        Overrides:
        updateTestData in class HtmlProxy
        Parameters:
        testDataType - A test data type supplied by getTestDataTypes.
        testData - The test data base object that requires updating.
        Returns:
        The testData passed in with appropriate updates.
        See Also:
        getTestDataTypes(), ITestData
      • getRows

        public com.rational.test.ft.domain.ProxyTestObject[] getRows()
      • getColumnHeaders

        public java.lang.String[] getColumnHeaders()
        Returns the visible text of the column header for the given dataCell.
        Returns:
        Column headers String, or null if not found.
      • getClearscriptSimpleName

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