IBM Rational Functional Tester
Version 8.1.1000
IBM Rational Functional Tester API Reference

Project Version 2.3

com.rational.test.ft.object.interfaces
Class DocumentTestObject

java.lang.Object   extended by com.rational.test.ft.object.interfaces.TestObject
      extended by com.rational.test.ft.object.interfaces.ClientTestObject
          extended by com.rational.test.ft.object.interfaces.GuiTestObject
              extended by com.rational.test.ft.object.interfaces.DocumentTestObject
All Implemented Interfaces:
IGraphical

public class DocumentTestObject
extends GuiTestObject

Provides script access to the general browser, which is the HTML Browser TestObject class.

Since:
RFT7.0.1

Field Summary
 
Fields inherited from class com.rational.test.ft.object.interfaces.TestObject
ref
 
Constructor Summary
DocumentTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject)
          For internal use.
DocumentTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject, TestObject anchor)
          For internal use.
DocumentTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject, TestObject anchor, long scriptCommandFlags)
          For internal use.
DocumentTestObject(TestObject obj)
          For internal use.
DocumentTestObject(com.rational.test.ft.object.TestObjectReference ref)
          For internal use.
 
Method Summary
 int getAjaxCompletedRequests()
          Return the count of completed AJAX request
 int getAjaxPendingRequests()
          Return the number of pending AJAX request.
 java.lang.String invokeScript(java.lang.String method)
          Execute JavaScript in the given page
 void setAjaxTrace(boolean value)
          To turn the AJAX Request tracing facility ON or OFF.
 void waitForAjaxCompletedRequests(int noOfCompletedRequests)
          Wait untill the specified count of AJAX request are completed
 void waitForAjaxPendingRequests()
          Wait until all pending request gets completed.
 void waitForAjaxPendingRequests(int noOfPendingRequests)
          Wait for the specified count of pending requests
 
Methods inherited from class com.rational.test.ft.object.interfaces.GuiTestObject
canTakeVP, click, click, click, click, clickRadio, doubleClick, doubleClick, doubleClick, doubleClick, drag, drag, drag, drag, dragToScreenPoint, dragToScreenPoint, dragToScreenPoint, ensureObjectIsVisible, getChildAtPoint, getClippedScreenRectangle, getImage, getImage, getScreenPoint, getScreenPoint, getScreenRectangle, getScreenSnapshot, getVisibleArea, hasFocus, hover, hover, hover, hover, invokeProxyWithGuiDelay, invokeProxyWithGuiDelay, isEnabled, isOpaque, isPointInObject, isShowing, mouseMove, mouseMove, nClick, nClickDrag, nClickDragToScreenPoint
 
Methods inherited from class com.rational.test.ft.object.interfaces.ClientTestObject
exists, find, find, findAndInvoke, findAndInvokeProxy, invoke, invokeProxy, unregister, waitForExistence
 
Methods inherited from class com.rational.test.ft.object.interfaces.TestObject
compare, compare, compareAndLog, compareAndLog, equals, find, findAndInvoke, getActualData, getChildren, getDescribedObject, getDescribedObjects, getDescriptiveName, getDomain, getField, getIndexer, getIndexer, getIndexers, getMappableChildren, getMappableParent, getMapProperties, getMethods, getNameInScript, getNonValueProperties, getObjectClassName, getObjectCustomClassName, getObjectReference, getOwnedObjects, getOwner, getParent, getProcess, getProperties, getProperty, getPropertyFromMap, getRecognitionProperties, getRecognitionPropertyWeight, getScriptCommandFlags, getStandardProperties, getTestData, getTestDataTypes, getTopMappableParent, getTopParent, hashCode, invoke, invokeProxy, isMappedObject, isSameObject, isScreenTestObject, isTopLevelTestObject, performTest, performTest, performTest, performTest, setIndexer, setIndexer, setMapProperties, setProperty, toString, updateTestData, waitForExistence
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentTestObject

public DocumentTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject)
For internal use. Constructs DocumentTestObject.

Since:
RFT7.0.1

DocumentTestObject

public DocumentTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject,                           TestObject anchor)
For internal use. Constructs DocumentTestObject.

Since:
RFT7.0.1

DocumentTestObject

public DocumentTestObject(com.rational.test.ft.object.map.SpyMappedTestObject mappedObject,                           TestObject anchor,                           long scriptCommandFlags)
For internal use. Constructs DocumentTestObject.

Since:
RFT7.0.1

DocumentTestObject

public DocumentTestObject(com.rational.test.ft.object.TestObjectReference ref)
For internal use. Constructs one DocumentTestObject from another TestObjectReference. Both are references to the same object.

Since:
RFT7.0.1

DocumentTestObject

public DocumentTestObject(TestObject obj)
For internal use. Constructs one TestObject from another. Both are references to the same object.

Since:
RFT7.0.1
Method Detail

setAjaxTrace

public void setAjaxTrace(boolean value)
To turn the AJAX Request tracing facility ON or OFF.

Parameters:
value - true for turning ON, false for turning OFF
Detail description:
Once the trace is truned ON, the subsequest number of uncompleted AJAX requests gets stored and can be retrived using getAjaxPendingRequests() API. Similarly, the number completed AJAX requests also get stored and can be retrieve using getAjaxCompletedRequests() API.
Example:
Turn on Ajax trace on a web url
document_ibmIndia().setAjaxTrace(true);
Since:
RFT7.0.1

getAjaxPendingRequests

public int getAjaxPendingRequests()
Return the number of pending AJAX request.

Returns:
int number of AJAX pending requests
Detail description:
Returns the number of pending AJAX requests at any given point of time since the first AjaxTraceOn . Returning 0 means there are no AJAX pending request.
Example:


document_ibmIndia().setAjaxTrace(true);

int pendingRequest = document_ibmIndia().getAjaxPendingRequests();

document_ibmIndia().setAjaxTrace(false);

Since:
RFT7.0.1

waitForAjaxPendingRequests

public void waitForAjaxPendingRequests()
Wait until all pending request gets completed.

Detail description:
This method used more often to sync up with all the pending AJAX requests
Example:


document_ibmIndia().setAjaxTrace(true);

document_ibmIndia().waitForAjaxPendingRequests();

document_ibmIndia().setAjaxTrace(false);

Since:
RFT7.0.1

waitForAjaxPendingRequests

public void waitForAjaxPendingRequests(int noOfPendingRequests)
Wait for the specified count of pending requests

Throws:
AjaxWaitTimeOutException() - on timeout.
Parameters:
noOfPendingRequests - - number of allowed pending requests
Detail description:
Wait until 'noOfPendingRequests' or fewer AJAX pending requests exists. It throws an exception on timeout. The time out value can be specified using the key rational.test.ft.html.ajax.timeoutattempts in ivory.properties which can be found in the "Rational Functional Tester " installation directory.
Example:
Wait for the 2 pending request to come


document_ibmIndia().setAjaxTrace(true);

document_ibmIndia().waitForAjaxPendingRequests(2);

document_ibmIndia().setAjaxTrace(false);

Since:
RFT7.0.1
See Also:
getAjaxPendingRequests()

getAjaxCompletedRequests

public int getAjaxCompletedRequests()
Return the count of completed AJAX request

Returns:
int number of completed AJAX requests
Detail description:
Returns the number of completed AJAX requests at any given point of time since the first AjaxTraceOn .
Example:


document_ibmIndia().setAjaxTrace(true);

int numCompletedRequest = document_ibmIndia().getAjaxCompletedRequests();

document_ibmIndia().setAjaxTrace(false);

Since:
RFT7.0.1

waitForAjaxCompletedRequests

public void waitForAjaxCompletedRequests(int noOfCompletedRequests)
Wait untill the specified count of AJAX request are completed

Throws:
AjaxWaitTimeOutException() - on timeout.
Parameters:
noOfCompletedRequests - - number of completed requests to wait
Detail description:
Wait until 'noOfCompletedRequests' or more AJAX requests to complete since the AjaxTrace on. Throws an exception on timeout. The time out value can be specified using the key rational.test.ft.html.ajax.timeoutattempts in ivory.properties which can be found in the "Rational Functional Tester " installation directory.
Example:
Wait for 2 completed AJAX requests


document_ibmIndia().setAjaxTrace(true);

int numCompletedRequest = document_ibmIndia().waitForAjaxCompletedRequests(2);

document_ibmIndia().setAjaxTrace(false);

Since:
RFT7.0.1

invokeScript

public java.lang.String invokeScript(java.lang.String method)
Execute JavaScript in the given page

Parameters:
method - java.lang.String the JavaScript method name
Returns:
value returns by script execution
Detail description:
Executes JavaScript strings in a given DocumentTestObject object. Internally uses EvalString() API provided by the Browsers to execute the script.
Example:
Invoke a JavaScript in a web url

document_ibmIndia().invokeScript("verifyCred('username', 'password')");

Since:
RFT7.0.1