com.rational.test.ft.domain.html

Class HtmlDocumentProxy

  • All Implemented Interfaces:
    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


    public class HtmlDocumentProxy
    extends HtmlGuiProxy
    Provides the proxy for HTML document objects in the HtmlTestDomainImplementation.
    • TestObject Interface: DocumentTestObject

    • Supported Test Data Types:
      TypeDesciption
      text Visible Text ITestDataText

    • Default Recognition Properties:
      • .class
      • .title
      • .url

    • Supported Canonical Properties:
      o
      PropertyUsage
      .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.
      .cookie This is the current value of the cookie for the document.
      .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.
      .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.
      .urlThis is the url of the document.

    Since:
    RFT1.0
    • Field Detail

      • debug

        protected static com.rational.test.ft.util.FtDebug debug
      • VSCROLLWIDTHPROPERTY

        public static final java.lang.String VSCROLLWIDTHPROPERTY
        See Also:
        Constant Field Values
      • HSCROLLHEIGHTPROPERTY

        public static final java.lang.String HSCROLLHEIGHTPROPERTY
        See Also:
        Constant Field Values
      • isClassIndexOnly

        public static boolean isClassIndexOnly
      • browserAppVersion

        public static java.lang.String browserAppVersion
        Returns the browser application name in case of Internet Explorer
    • Constructor Detail

      • HtmlDocumentProxy

        public HtmlDocumentProxy(HtmlTestDomainImplementation domain,
                                 com.rational.test.ft.domain.IChannel channel,
                                 long handle)
    • 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.
      • processMouseEvent

        public void processMouseEvent(com.rational.test.ft.domain.IMouseActionInfo action)
        Description copied from class: HtmlGuiProxy
        Return a MethodSpecification for the specified mouse event. This is the primary record interface for mouse events against a particular control. This implementation calls getActionArgs to generate the appropriate subitem specification. Subclasses which generate subitem specifications should override getActionArgs.
        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)
      • getDescriptiveName

        public java.lang.String getDescriptiveName()
        Returns a descriptive name used for the object in the script. For HTML documents the name contains the title, if it exists, or the URL.
        Overrides:
        getDescriptiveName in class HtmlProxy
        Returns:
        A descriptive object name.
        Since:
        RFT1.0
      • 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
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface com.rational.test.ft.object.interfaces.IGraphical
        Overrides:
        isEnabled in class HtmlGuiProxy
      • shouldBeMapped

        public boolean shouldBeMapped()
        Always returns true, because HTML document objects must always be mapped.
        Overrides:
        shouldBeMapped in class HtmlProxy
        Returns:
        true element has an id or name. false not a supported HTML object type
      • getPropertyInternal

        public java.lang.Object getPropertyInternal(java.lang.String propertyName)
        Overrides:
        getPropertyInternal in class HtmlProxy
      • getDocumentElement

        public HtmlProxy getDocumentElement()
        Get the DOM document element for the document. This element corresponds to the HTML tag.
      • getClippingParent

        public com.rational.test.ft.object.interfaces.IGraphical getClippingParent()
        Description copied from class: HtmlGuiProxy
        Get the clipping parent for this object. The clipping parent is the object whose rectangle will clip all of its children, usually the browser or a frame. Unfortunately, it can also be a div tag in the object hierarchy, so going directly to the document does not worl
        Overrides:
        getClippingParent in class HtmlGuiProxy
      • 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
      • findElementWithName

        public HtmlProxy findElementWithName(java.lang.String name)
        Description copied from class: HtmlProxy
        Find the element that is a child of this element which has the given name.
        Overrides:
        findElementWithName in class HtmlProxy
      • getElementsByName

        public java.util.Enumeration getElementsByName(java.lang.String name)
      • getElementsByName

        public java.util.Enumeration getElementsByName(java.lang.String name,
                                                       com.rational.test.ft.sys.ContextObject contextobject)
      • getElementsByName

        public long getElementsByName(long handle,
                                      java.lang.String name)
      • getElementsByNameN

        public long getElementsByNameN(long handle,
                                       java.lang.String name)
      • getElementsByNameEnumeration

        public java.util.Enumeration getElementsByNameEnumeration(long handle,
                                                                  java.lang.String name)
      • findElementWithDynamicFind

        public com.rational.test.ft.object.manager.FindResult findElementWithDynamicFind(com.rational.test.ft.object.map.IMappedTestObject[] pathToFind,
                                                                                         int myLevel)
        Specified by:
        findElementWithDynamicFind in interface com.rational.test.ft.domain.IQuickFind
        Overrides:
        findElementWithDynamicFind in class HtmlProxy
      • find

        public com.rational.test.ft.object.manager.FindResult find(com.rational.test.ft.object.map.IMappedTestObject[] pathToFind,
                                                                   int myLevel)
        Specified by:
        find in interface com.rational.test.ft.domain.IQuickFind
        Overrides:
        find in class HtmlProxy
      • findFrameForFrameEdge

        public HtmlProxy findFrameForFrameEdge(int borderWidth,
                                               java.awt.Point pt)
        Return the FrameProxy for the frame edge which contains pt Called when pt was found on a FRAMESET element
      • findImageForMap

        public HtmlProxy findImageForMap(HtmlProxy map,
                                         java.awt.Point pt)
        Return the ImageProxy associated with the map, which contains pt
      • getApplicationName

        public java.lang.String getApplicationName()
      • findElementsDirectly

        public com.rational.test.ft.domain.ProxyTestObject[] findElementsDirectly(boolean mappable)
        Specified by:
        findElementsDirectly in interface com.rational.test.ft.domain.IQuickFind
        Overrides:
        findElementsDirectly in class HtmlProxy
      • getElementsByTagInProxyTestObjects

        public com.rational.test.ft.domain.ProxyTestObject[] getElementsByTagInProxyTestObjects(java.lang.String tag)
        Returns mappable proxy test objects with the specified which are at descendant level
        Specified by:
        getElementsByTagInProxyTestObjects in interface com.rational.test.ft.domain.IQuickFind
        Overrides:
        getElementsByTagInProxyTestObjects in class HtmlProxy
      • getMappableElementsByTagInProxyTestObjects

        public com.rational.test.ft.domain.ProxyTestObject[] getMappableElementsByTagInProxyTestObjects(java.lang.String tag,
                                                                                                        com.rational.test.ft.sys.ContextObject contextobject)
        Returns proxy test objects with the specified which are at descendant level
      • getMappableElementsByTagInCurrentDoc

        public com.rational.test.ft.domain.ProxyTestObject[] getMappableElementsByTagInCurrentDoc(java.lang.String tag,
                                                                                                  com.rational.test.ft.sys.ContextObject contextobject)
      • getMappableElementsFromVector

        public com.rational.test.ft.domain.ProxyTestObject[] getMappableElementsFromVector(java.util.Vector v)
      • getMappableElementsByTagInProxyTestObjects

        public com.rational.test.ft.domain.ProxyTestObject[] getMappableElementsByTagInProxyTestObjects(java.lang.String tag)
        Returns proxy test objects with the specified which are at descendant level
        Specified by:
        getMappableElementsByTagInProxyTestObjects in interface com.rational.test.ft.domain.IQuickFind
        Overrides:
        getMappableElementsByTagInProxyTestObjects in class HtmlProxy
      • getAllDocumentHandlesInDocument

        public long[] getAllDocumentHandlesInDocument(long handle)
      • getElementsByTagInAllDocuments

        public java.util.Vector getElementsByTagInAllDocuments(java.lang.String tag,
                                                               com.rational.test.ft.sys.ContextObject contextobject)
        Returns child proxies with the specified which are at descendant level
      • getElementsByTagInAllDocuments

        public java.util.Vector getElementsByTagInAllDocuments(java.lang.String tag)
        Returns child proxies with the specified which are at descendant level
      • getElementsByNameInProxyTestObjects

        public com.rational.test.ft.domain.ProxyTestObject[] getElementsByNameInProxyTestObjects(java.lang.String name)
        Specified by:
        getElementsByNameInProxyTestObjects in interface com.rational.test.ft.domain.IQuickFind
        Overrides:
        getElementsByNameInProxyTestObjects in class HtmlProxy
      • getMappableElementsByNameInProxyTestObjects

        public com.rational.test.ft.domain.ProxyTestObject[] getMappableElementsByNameInProxyTestObjects(java.lang.String name)
        Specified by:
        getMappableElementsByNameInProxyTestObjects in interface com.rational.test.ft.domain.IQuickFind
        Overrides:
        getMappableElementsByNameInProxyTestObjects in class HtmlProxy
      • getElementsByIdInProxyTestObjects

        public com.rational.test.ft.domain.ProxyTestObject[] getElementsByIdInProxyTestObjects(java.lang.String id)
      • getMappableElementsByIdInProxyTestObjects

        public com.rational.test.ft.domain.ProxyTestObject[] getMappableElementsByIdInProxyTestObjects(java.lang.String id)
      • getMappableElementsByIdInProxyTestObjects

        public com.rational.test.ft.domain.ProxyTestObject[] getMappableElementsByIdInProxyTestObjects(java.lang.String id,
                                                                                                       com.rational.test.ft.sys.ContextObject contextobject)
      • getElementsByIdInAllDocuments

        public java.util.Vector getElementsByIdInAllDocuments(java.lang.String id,
                                                              com.rational.test.ft.sys.ContextObject contextobject)
      • getElementById

        public com.rational.test.ft.domain.ProxyTestObject getElementById(java.lang.String id,
                                                                          com.rational.test.ft.sys.ContextObject contextobject)
      • getMappableElementsByNameInProxyTestObjects

        public com.rational.test.ft.domain.ProxyTestObject[] getMappableElementsByNameInProxyTestObjects(java.lang.String name,
                                                                                                         com.rational.test.ft.sys.ContextObject contextobject)
      • getElementsByNameInAllDocuments

        public java.util.Vector getElementsByNameInAllDocuments(java.lang.String name)
      • getElementsByNameInAllDocuments

        public java.util.Vector getElementsByNameInAllDocuments(java.lang.String name,
                                                                com.rational.test.ft.sys.ContextObject contextobject)
      • getAllDocumentsInsideRecursively

        public java.util.Vector getAllDocumentsInsideRecursively()
        Returns the children document proxies at the descendant level
      • getChildDocumentsInDocument

        protected HtmlDocumentProxy[] getChildDocumentsInDocument()
      • getChildDocumentsEnumeration

        protected java.util.Enumeration getChildDocumentsEnumeration()
      • getChildDocuments

        protected long getChildDocuments(long handle)
      • getChildDocumentsN

        protected long getChildDocumentsN(long handle)
      • getElementsByTag

        public java.util.Enumeration getElementsByTag(java.lang.String tag)
        Overrides:
        getElementsByTag in class HtmlProxy
      • getElementsByTag

        public long getElementsByTag(long handle,
                                     java.lang.String tag)
        Overrides:
        getElementsByTag in class HtmlProxy
      • getElementsByTagN

        public long getElementsByTagN(long handle,
                                      java.lang.String tag)
        Overrides:
        getElementsByTagN in class HtmlProxy
      • getElementsByTagEnumeration

        public java.util.Enumeration getElementsByTagEnumeration(long handle,
                                                                 java.lang.String tag)
        Overrides:
        getElementsByTagEnumeration in class HtmlProxy
      • getElementHandleByIdFromAllDocs

        public long getElementHandleByIdFromAllDocs(java.lang.String id)
      • getElementById

        public com.rational.test.ft.domain.ProxyTestObject getElementById(java.lang.String id)
      • getElementById

        public long getElementById(long handle,
                                   java.lang.String id)
      • getElementByIdN

        public long getElementByIdN(long handle,
                                    java.lang.String id)
      • getChildAtPoint

        public java.lang.Object getChildAtPoint(java.awt.Point pt)
        Description copied from class: HtmlGuiProxy
        Finds the most interesting child object at the specified point. Note that the point is relative to the top left corner of the screen, and not the component itself or its parent.

        If this object has no children, it should return 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()
      • getChildAtPointInternal

        public java.lang.Object getChildAtPointInternal(java.awt.Point pt,
                                                        boolean setClassIndex)
      • getDefaultPointToClick

        protected java.awt.Point getDefaultPointToClick()
        Description copied from class: HtmlGuiProxy
        Determines the default click point by performing hit tests on candidates. This is required since a the point to click should always click on the object 1) Try the center. 2) try points along a diagonal from top left to bottom right.
        Overrides:
        getDefaultPointToClick in class HtmlGuiProxy
      • click

        public void click(com.rational.test.ft.script.MouseModifiers modifiers)
        Specified by:
        click in interface com.rational.test.ft.object.interfaces.IGraphical
        Overrides:
        click in class HtmlGuiProxy
      • click

        public void click(com.rational.test.ft.script.MouseModifiers modifiers,
                          java.awt.Point pt)
        Specified by:
        click in interface com.rational.test.ft.object.interfaces.IGraphical
        Overrides:
        click in class HtmlGuiProxy
      • doubleClick

        public void doubleClick(com.rational.test.ft.script.MouseModifiers modifiers)
        Specified by:
        doubleClick in interface com.rational.test.ft.object.interfaces.IGraphical
        Overrides:
        doubleClick in class HtmlGuiProxy
      • doubleClick

        public void doubleClick(com.rational.test.ft.script.MouseModifiers modifiers,
                                java.awt.Point pt)
        Specified by:
        doubleClick in interface com.rational.test.ft.object.interfaces.IGraphical
        Overrides:
        doubleClick in class HtmlGuiProxy
      • setClassIndex

        protected void setClassIndex()
        Description copied from class: HtmlProxy
        Calculate and set the classindex for this object.
        Overrides:
        setClassIndex in class HtmlProxy
      • setAjaxTraceOn

        public void setAjaxTraceOn()
      • setAjaxTraceOff

        public void setAjaxTraceOff()
      • getAjaxPendingRequests

        public int getAjaxPendingRequests()
      • getAjaxCompletedRequests

        public int getAjaxCompletedRequests()
      • getAjaxTimeoutAttempts

        public int getAjaxTimeoutAttempts()
      • invokeScript

        public java.lang.String invokeScript(java.lang.String method,
                                             java.lang.String scriptLang)
      • invokeScript

        public java.lang.String invokeScript(long handle,
                                             java.lang.String method,
                                             java.lang.String scriptLang)
      • getElementHandleById

        public long getElementHandleById(java.lang.String elementId)
      • isScoreForFindBYIdorName

        public boolean isScoreForFindBYIdorName()
        Specified by:
        isScoreForFindBYIdorName in interface com.rational.test.ft.domain.IQuickFind
        Overrides:
        isScoreForFindBYIdorName in class HtmlProxy
      • click

        public void click(com.rational.test.ft.script.Subitem subitem)