org.safs.rational
Class CFHtmlDocument

java.lang.Object
  extended by org.safs.Processor
      extended by org.safs.ComponentFunction
          extended by org.safs.rational.CFComponent
              extended by org.safs.rational.CFHtmlDocument

public class CFHtmlDocument
extends CFComponent


Purpose: CFHtmlDocument, process HTMLDocument components. See the file ObjectTypesMap.dat for cross reference as to which map to us.
Lifetime: instantiated by TestStepProcessor

Since:
Nov 10, 2004
Nov 10, 2004 (CANAGL) Original Release
Mar 18, 2008 (LeiWang) Added CaptureBodySourceToFile and VerifyBodySource support
Mar 18, 2008 (JunwuMa) Reorganized localProcess(). Added CaptureBodyTextToFile and VerifyBodyText. Added ClickLink based on orignal CLICKLINKBEGINNING and CLICKLINKCONTAINING
Mar 18, 2008 (LeiWang) Modify method getHtmlBodyContent()

Field Summary
static java.lang.String CAPTUREBODYSOURCETOFILE
           
static java.lang.String CAPTUREBODYTEXTTOFILE
           
static java.lang.String CLICKLINK
           
static java.lang.String CLICKLINKBEGINNING
           
static java.lang.String CLICKLINKCONTAINING
           
static java.lang.String HTML_HTMLBROWSER
           
static java.lang.String HTML_HTMLDOCUMENT
           
static java.lang.String PROXY_SERVER_KEY
           
static java.lang.String PROXY_SERVER_PORT_KEY
           
static java.lang.String USE_PROXY_KEY
           
static java.lang.String VERIFYBODYSOURCE
           
static java.lang.String VERIFYBODYTEXT
           
 
Fields inherited from class org.safs.rational.CFComponent
ALTLEFTDRAG, ASSIGNPROPERTYVARIABLE, CAPTUREOBJECTDATATOFILE, CAPTUREPROPERTIESTOFILE, CAPTUREPROPERTYTOFILE, CLEARAPPMAPCACHE, CLICK, CLOSEWINDOW, COMPONENTCLICK, CTRLALTLEFTDRAG, CTRLCLICK, CTRLLEFTDRAG, CTRLRIGHTCLICK, CTRLSHIFTLEFTDRAG, DOUBLECLICK, GETGUIIMAGE, GUIDOESEXIST, GUIDOESNOTEXIST, HOVERMOUSE, HSCROLLTO, INPUTCHARACTERS, INPUTKEYS, LEFTDRAG, MAXIMIZE, MINIMIZE, obj1, RESTORE, RIGHTCLICK, RIGHTDRAG, script, SELECTMENUITEM, SELECTMENUITEMCONTAINS, SETPOSITION, SETPROPERTYVALUE, SHIFTCLICK, SHIFTLEFTDRAG, VERIFYARRAYPROPERTYTOFILE, VERIFYBINARYFILETOFILE, VERIFYCLIPBOARDTOFILE, VERIFYFILETOFILE, VERIFYGUIIMAGETOFILE, VERIFYMENUITEM, VERIFYMENUITEMCONTAINS, VERIFYOBJECTDATATOFILE, VERIFYPROPERTY, VERIFYPROPERTYCONTAINS, VERIFYPROPERTYTOFILE, VERIFYTEXTFILETOFILE, VERIFYVALUECONTAINS, VERIFYVALUEEQUALS, VERIFYVALUES, VERIFYVALUESIGNORECASE, VSCROLLTO, WAITFORGUI, WIN_MAXIMIZED, WIN_MINIMIZED, WIN_NORMAL
 
Fields inherited from class org.safs.ComponentFunction
action, compName, mapname, utils, windowName
 
Fields inherited from class org.safs.Processor
breakpointsOn, CASE_INSENSITIVE_FLAG, CASEINSENSITIVE_FLAG, clearProxiesAlways, commandLineBreakpoint, customStr, customText, DEBUG_MESSAGE, debugStr, debugText, DEFAULT_CUSTOM_PROCESSOR_PACKAGE, DEFAULT_CUSTOM_PROCESSOR_SUBPACKAGE, DEFAULT_PROCESSOR_PACKAGE, FAILED_MESSAGE, FAILED_OK_MESSAGE, failedStr, failedText, FAILURE_DETAIL, GENERIC_MESSAGE, genericStr, genericText, LINE_FAILURE_4, log, myBreakpointsOn, otherStr, otherText, PARAM_SIZE_1, PARAM_SIZE_2, PARAM_SIZE_3, PARAM_SIZE_4, params, PASSED_MESSAGE, passedStr, passedText, PRE_TXT_SUCCESS_4, PRE_TXT_SUCCESS_5, processorConfigSet, processorMap, recordProcessed, RECTYPE_DRIVER_COMMAND, RECTYPE_DRIVER_COMMAND_F, RECTYPE_DRIVER_COMMAND_W, RECTYPE_TEST_STEP, RECTYPE_TEST_STEP_F, RECTYPE_TEST_STEP_W, SAFS_CLEARPROXIESALWAYS_ITEM, SAFS_COMMANDLINEBREAKPOINT_ITEM, SAFS_COMMANDLINEBREAKPOINT_VARIABLE, SAFS_PARAMS_FILE, SAFS_RESBUN_NAME, SAFS_SECSWAITFORCOMPONENT_ITEM, SAFS_SECSWAITFORCOMPONENT_VARIABLE, SAFS_SECSWAITFORWINDOW_ITEM, SAFS_SECSWAITFORWINDOW_VARIABLE, SAFS_TESTDOMAINS_ITEM, SAFS_TESTDOMAINS_VARIABLE, secsWaitForComponent, secsWaitForWindow, SENT_MSG_3, testDomains, testRecordData, TXT_FAILURE_1, TXT_FAILURE_2, TXT_FAILURE_3, TXT_FAILURE_4, TXT_FAILURE_5, TXT_SUCCESS_1, TXT_SUCCESS_2, TXT_SUCCESS_2a, TXT_SUCCESS_3, TXT_SUCCESS_4, TXT_SUCCESS_5, WARNING_MESSAGE, WARNING_OK_MESSAGE, warningStr, warningText
 
Constructor Summary
CFHtmlDocument()
          
Purpose: constructor, calls super
 
Method Summary
protected  void doCaptureBodyTextToFile()
          Purpose: perform action CaptureBodyTextToFile, capture the body text in target HtmlDocument and write the content to a new file with UTF8 format.
protected  void doVerifyBodyText()
          Purpose: perform action VerifyBodyText, capture body text in target HtmlDocument, then compare the content captured with the content of a bench file (UTF8 formated).
protected  void localProcess()
          
Purpose: process: process the testRecordData
This is our specific version.
 
Methods inherited from class org.safs.rational.CFComponent
captureObjectData, captureObjectDataToFile, checkForCoord, checkForCoord, componentClick, convertObjectValueToString, extractTreeItemsSub, findMenuBars, formatObjectData, getAppletsBrowser, getComponentRectangle, getHelpers, getObjectProperty, getObjectPropertyFromProperties, getUserObject, isDotnetDomain, isFlexDomain, isHtmlDomain, isJavaDomain, isSwtDomain, isSWTWidget, isWinDomain, listAllProperties, listAllProperties, listMethods, listNonValueProperties, listProperties, matchedPathOfMenuItem, parseWhereInfo, performClick, preformDrag, process, selectMenuItem, setPosition, tobj, verifyMenuItem
 
Methods inherited from class org.safs.ComponentFunction
action_getGuiImage, action_verifyGuiImageToFile, componentExecutedFailureMessage, componentFailureMessage, componentSuccessMessage, convertCoords, convertNum, getAlternateParams, getHelpersWorker, issueActionFailure, issueActionOnXFailure, issueErrorPerformingAction, issueErrorPerformingActionOnX, issueFileErrorFailure, issueInputRecordFailure, issueParameterCountFailure, issueParameterCountFailure, issueParameterValueFailure, issuePassedSuccess, issuePassedSuccessUsing, issueUnknownErrorFailure, isSupportedRecordType, lookupAppMapCoordReference, lookupAppMapNumReference, lookupAppMapReference, updateFromTestRecordData
 
Methods inherited from class org.safs.Processor
activateBreakpoint, checkBreakpoints, checkMyBreakpoints, delay, distributeConfigInformation, getAppMapItem, getChainedProcessor, getClassInstance, getClearProxiesAlways, getCustomProcClassNames, getCustomProcInstancePath, getLogUtilities, getParams, getProcClassNames, getProcInstance, getProcInstancePath, getRequiredField, getSecsWaitForComponent, getSecsWaitForWindow, getStandardErrorMessage, getTestRecordData, getVariable, hasChainedProcessor, initProcessorAndProcess, instanceProcessorAndProcess, isBreakpointsOn, isComponentFunctionRecord, isDriverCommandRecord, isEngineCommandRecord, isMyBreakpointsOn, isRecordProcessed, paramsFailedMsg, paramsFailedMsg, processCustomProcessor, processSubclassProcessor, setBreakpointsOn, setChainedProcessor, setClearProxiesAlways, setCommandLineBreakpoint, setCustomProcInstancePath, setLogUtilities, setMyBreakpointsOn, setParams, setProcInstance, setProcInstancePath, setRecordProcessed, setSecsWaitForComponent, setSecsWaitForWindow, setTestDomains, setTestRecordData, setVariable, standardFailureMessage, substituteVariable, validateParamSize, validProcessorClassName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAPTUREBODYSOURCETOFILE

public static final java.lang.String CAPTUREBODYSOURCETOFILE
See Also:
Constant Field Values

CAPTUREBODYTEXTTOFILE

public static final java.lang.String CAPTUREBODYTEXTTOFILE
See Also:
Constant Field Values

CLICKLINK

public static final java.lang.String CLICKLINK
See Also:
Constant Field Values

CLICKLINKBEGINNING

public static final java.lang.String CLICKLINKBEGINNING
See Also:
Constant Field Values

CLICKLINKCONTAINING

public static final java.lang.String CLICKLINKCONTAINING
See Also:
Constant Field Values

VERIFYBODYSOURCE

public static final java.lang.String VERIFYBODYSOURCE
See Also:
Constant Field Values

VERIFYBODYTEXT

public static final java.lang.String VERIFYBODYTEXT
See Also:
Constant Field Values

USE_PROXY_KEY

public static final java.lang.String USE_PROXY_KEY
See Also:
Constant Field Values

PROXY_SERVER_KEY

public static final java.lang.String PROXY_SERVER_KEY
See Also:
Constant Field Values

PROXY_SERVER_PORT_KEY

public static final java.lang.String PROXY_SERVER_PORT_KEY
See Also:
Constant Field Values

HTML_HTMLDOCUMENT

public static final java.lang.String HTML_HTMLDOCUMENT
See Also:
Constant Field Values

HTML_HTMLBROWSER

public static final java.lang.String HTML_HTMLBROWSER
See Also:
Constant Field Values
Constructor Detail

CFHtmlDocument

public CFHtmlDocument()

Purpose: constructor, calls super

Method Detail

localProcess

protected void localProcess()

Purpose: process: process the testRecordData
This is our specific version. We subclass the generic CFComponent. The actions handled here are:


NOTE: the 'activate' keywords didn't seem to work on the regression test because the use the guiObject.click instead of guiObject.setState method. The latter seems to work better
Side Effects: Processor.testRecordData statusCode is set based on the result of the processing
State Read: Processor.testRecordData, Processor.params
Assumptions: none

Overrides:
localProcess in class CFComponent

doCaptureBodyTextToFile

protected void doCaptureBodyTextToFile()
                                throws SAFSException
Purpose: perform action CaptureBodyTextToFile, capture the body text in target HtmlDocument and write the content to a new file with UTF8 format. VerifyBodyText shall use the UTF8 file for comparing.

Throws:
SAFSException
See Also:
doVerifyBodyText

doVerifyBodyText

protected void doVerifyBodyText()
                         throws SAFSException
Purpose: perform action VerifyBodyText, capture body text in target HtmlDocument, then compare the content captured with the content of a bench file (UTF8 formated). The bench file was already created by doCaptureBodyTextToFile. Expected a benchmark file in UTF8 format.

Throws:
SAFSException, - when catching a non-SAFSException, a new SAFSException with error message will be thrown.
SAFSException
See Also:
doCaptureBodyTextToFile