public class CFComponent extends ComponentFunction
For some functionality we use the java.awt.Robot and our own InputKeysParser classes.
InputKeysParser requires the availability of a SAFSKeycodeMap.dat file which is normally located in the SAFS\lib directory. This file will be loaded through ClassLoader.getSystemResourceAsStream.
Robot,
InputKeysParser,
CreateUnicodeMap,
ClassLoader.getSystemResourceAsStream(java.lang.String)ComponentFunction.Window| Modifier and Type | Field and Description |
|---|---|
protected SGuiObject |
compObject |
static InputKeysParser |
keysparser |
static java.awt.Robot |
robot |
protected com.thoughtworks.selenium.Selenium |
selenium |
protected STestRecordHelper |
sHelper |
protected SeleniumGUIUtilities |
sUtils |
protected SGuiObject |
winObject |
action, ALTCLICK, ALTLEFTDRAG, altText, ASSIGNPROPERTYVARIABLE, CAPTUREOBJECTDATATOFILE, CAPTUREPROPERTIESTOFILE, CAPTUREPROPERTYTOFILE, CLEARAPPMAPCACHE, CLICK, CLOSEWINDOW, compName, COMPONENTCLICK, CTRLALTLEFTDRAG, CTRLCLICK, CTRLLEFTDRAG, CTRLRIGHTCLICK, CTRLSHIFTLEFTDRAG, DOUBLECLICK, GETGUIIMAGE, GETTEXTFROMGUI, GUIDOESEXIST, GUIDOESNOTEXIST, HOVERMOUSE, HSCROLLTO, INPUTCHARACTERS, INPUTKEYS, ISPROPERTYEXIST, iterator, LEFTDRAG, LOCATESCREENIMAGE, mapname, MAXIMIZE, MINIMIZE, MOUSECLICK, OBJECT_DATA, PARAM_FILTER, PARAM_UUID, PROPERTY_DOT_itemText, PROPERTY_innerHTML, PROPERTY_innerText, PROPERTY_Items, PROPERTY_text, PROPERTY_textContent, RELATIVE_TO_PARENT, RELATIVE_TO_SCREEN, RESTORE, RIGHTCLICK, RIGHTDRAG, SAVETEXTFROMGUI, SELECTMENUITEM, SELECTMENUITEMCONTAINS, SENDEVENT, SETPOSITION, SETPROPERTYVALUE, SHIFTCLICK, SHIFTLEFTDRAG, TEST_DATA_SUFFIX, utils, VERIFYARRAYPROPERTYTOFILE, VERIFYBINARYFILETOFILE, VERIFYCLIPBOARDTOFILE, VERIFYFILETOFILE, VERIFYGUIIMAGETOFILE, VERIFYMENUITEM, VERIFYMENUITEMCONTAINS, VERIFYOBJECTDATATOFILE, VERIFYPROPERTY, VERIFYPROPERTYCONTAINS, VERIFYPROPERTYTOFILE, VERIFYTEXTFILETOFILE, VERIFYVALUECONTAINS, VERIFYVALUEEQUALS, VERIFYVALUES, VERIFYVALUESIGNORECASE, VSCROLLTO, WAITFORGUI, windowNamebreakpointsOn, 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, RFSMCache, RFSMOnly, RFT_FIND_SEARCH_MODE_ALGORITHM, RFT_FIND_SEARCH_MODE_CACHE, 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, testrecordStackable, 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_3a, TXT_SUCCESS_4, TXT_SUCCESS_5, unexpectedAlertBehaviour, WARNING_MESSAGE, WARNING_OK_MESSAGE, warningStr, warningText| Constructor and Description |
|---|
CFComponent() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_maximize()
Maximize the current window
|
protected void |
_minimize()
Minimize the current window
|
protected void |
_restore()
Perform the "restore" action on the current window.
|
protected void |
_setPosition(java.awt.Point position)
Subclass should give its own implementation
|
protected void |
_setSize(java.awt.Dimension size)
Subclass should give its own implementation
|
protected void |
action_getGuiImage()
Processes a Component Function Test Record to capture a screen GUI image to a file.
|
protected void |
action_verifyGuiImageToFile()
Processes a Component Function Test Record to verify a screen GUI image to a file.
|
protected java.util.Collection<java.lang.String> |
captureObjectData() |
protected void |
closeWindow()
Close the current window
|
protected void |
componentClick()
Purpose: componentClick |
protected boolean |
exist()
To test if the component exists or not.
The sub class may test the component's visibility also. |
protected java.awt.Rectangle |
getComponentBounds(java.lang.String s)
Gets the size of the component
|
protected java.awt.Rectangle |
getComponentRectangle()
Do nothing method returns null.
|
protected java.awt.Rectangle |
getComponentRectangleOnScreen()
Get the absolute 'Rectangle bounds' of the Component, which means the rectangle is relative to the
whole screen, NOT to a window/browser. |
protected java.util.Map<java.lang.String,java.lang.Object> |
getProperties() |
protected java.lang.Object |
getPropertyObject(java.lang.String propertyName) |
protected java.awt.Rectangle |
getWindowRectangleOnScreen()
Get the absolute 'Rectangle bounds' of the Window, which means the rectangle is relative to the
whole screen. |
protected void |
inputKeystrokes()
Purpose: inputKeys and inputCharacters |
protected void |
localProcess() |
protected void |
maximize()
Maximize the current window.
|
protected void |
minimize()
Minimize the current window.
|
protected boolean |
performHoverMouse(java.awt.Point point,
int milliseconds)
Purpose: perform hovering mouse at 'point' for 'milliseconds' period on a Component.
Subclass may need to give a specific implementation by tools (RJ, Selenium etc.) API. |
void |
process()
The primary method that all subclasses must implement.
|
protected void |
restore()
Restore the current window.
|
protected void |
scrollToAndClickComponent(SGuiObject o)
Scrolls to a component then left clicks on it.
|
protected void |
scrollToComponent(SGuiObject o)
Scrolls to a component on the page
|
protected void |
setPosition()
perform SetPosition to move Main Window, resize it and set its status.
|
protected void |
verifyProperty()
Purpose: verifyProperty |
_close, action_ComputedStyle, action_GetSaveTextFromGUI, action_showOnPage, assignPropertyVariable, captureObjectDataToFile, capturePropertiesToFile, capturePropertyToFile, checkForCoord, checkForCoord, clearAppMapCache, clearCache, close, componentExecutedFailureMessage, componentFailureMessage, componentProcess, componentSuccessMessage, convertCoords, convertLine, convertNum, convertWindowPosition, ConvertWindowPosition, deduceImageRect, dragTo, executeScript, getAlternateParams, getHelpers, getHelpersWorker, getPossibleMapItem, getProperty, getPropertyCollection, getPropertyCollection, getRectangleImage, getStringValue, getUUIDBoolean, guiDoesExist, hoverMouse, hoverScreenLocation, isClickAction, isPropertyExist, issueFileErrorFailure, issueParameterCountFailure, issueParameterCountFailure, issueParameterValueFailure, issuePassedSuccess, issuePassedSuccessUsing, issueUnknownErrorFailure, isSupportedRecordType, locateScreenImage, lookupAppMapCoordReference, lookupAppMapLineReference, lookupAppMapNumReference, lookupAppMapReference, normalizeFileEncoding, normalizePropertyCollection, performDrag, performScorll, selectMenuItem, sendEvent, setIterator, setPropertyValue, setRectVars, showComponentAsMuchPossible, updateFromTestRecordData, verifyClipboardToFile, verifyFileToFile, verifyMenuItem, verifyObjectDataToFile, verifyPropertiesToFile, verifyPropertyContains, verifyPropertyToFile, verifyValueContains, verifyValues, waitForGUI, waitForObjectactivateBreakpoint, checkBreakpoints, checkMyBreakpoints, deduceBenchFile, deduceDiffFile, deduceProjectFile, deduceTestFile, delay, distributeConfigInformation, getAbsolutFileName, getAppMapItem, getChainedProcessor, getClassInstance, getClearProxiesAlways, getCustomProcClassNames, getCustomProcInstancePath, getLogUtilities, getParams, getProcClassNames, getProcInstance, getProcInstancePath, getRequiredField, getSecsWaitForComponent, getSecsWaitForWindow, getStandardErrorMessage, getTestRecordData, getUnexpectedAlertBehaviour, getVariable, hasChainedProcessor, initProcessorAndProcess, instanceProcessorAndProcess, isBreakpointsOn, isComponentFunctionRecord, isDriverCommandRecord, isEngineCommandRecord, isMyBreakpointsOn, isRecordProcessed, isRFSMCache, isRFSMOnly, issueActionFailure, issueActionOnXFailure, issueErrorPerformingAction, issueErrorPerformingActionOnX, issueErrorPerformingActionUsing, issueInputRecordFailure, issueInputRecordFailure, issuePassedSuccess, logFailureMessage, normalizeTestFileName, paramsFailedMsg, paramsFailedMsg, popTestRecord, processCustomProcessor, processSubclassProcessor, pushTestRecord, setAtEndOfProcess, setBreakpointsOn, setChainedProcessor, setClearProxiesAlways, setCommandLineBreakpoint, setCustomProcInstancePath, setLogUtilities, setMyBreakpointsOn, setParams, setProcInstance, setProcInstancePath, setRecordProcessed, setRFSMCache, setRFSMOnly, setSecsWaitForComponent, setSecsWaitForWindow, setTestDomains, setTestRecordData, setUnexpectedAlertBehaviour, setVariable, standardFailureMessage, substituteVariable, validateParamSize, validProcessorClassNameprotected com.thoughtworks.selenium.Selenium selenium
protected SeleniumGUIUtilities sUtils
protected STestRecordHelper sHelper
protected SGuiObject winObject
protected SGuiObject compObject
public static java.awt.Robot robot
public static InputKeysParser keysparser
public void process()
ProcessorThus, any subclassing Processor should attempt to process it's own commands and then invoke super.process() to try any chained Processor(s).
Otherwise, by default executes setRecordProcessed(false) if no chainedProcessor is present.
protected void localProcess()
protected void restore()
throws SAFSException
ComponentFunctionrestore in class ComponentFunctionSAFSExceptionprotected void maximize()
throws SAFSException
ComponentFunctionmaximize in class ComponentFunctionSAFSExceptionprotected void minimize()
throws SAFSException
ComponentFunctionminimize in class ComponentFunctionSAFSExceptionprotected void action_getGuiImage()
throws SAFSException
ComponentFunctionaction_getGuiImage in class ComponentFunctionSAFSExceptionprotected void action_verifyGuiImageToFile()
throws SAFSException
ComponentFunctionaction_verifyGuiImageToFile in class ComponentFunctionSAFSExceptionprotected void _setPosition(java.awt.Point position)
throws SAFSException
_setPosition in class ComponentFunctionSAFSExceptionprotected void _setSize(java.awt.Dimension size)
throws SAFSException
_setSize in class ComponentFunctionSAFSExceptionprotected void _restore()
throws SAFSException
_restore in class ComponentFunctionSAFSExceptionprotected void _maximize()
throws SAFSException
_maximize in class ComponentFunctionSAFSExceptionprotected void _minimize()
throws SAFSException
_minimize in class ComponentFunctionSAFSExceptionprotected void closeWindow()
throws SAFSException
closeWindow in class ComponentFunctionSAFSExceptionprotected void setPosition()
throws SAFSException
ComponentFunctionsetPosition in class ComponentFunctionSAFSExceptionprotected boolean exist()
throws SAFSException
ComponentFunctionexist in class ComponentFunctionSAFSExceptionprotected void verifyProperty()
throws SAFSException
verifyProperty in class ComponentFunctionSAFSExceptionprotected void componentClick()
throws SAFSException
componentClick in class ComponentFunctionSAFSExceptionprotected void inputKeystrokes()
throws SAFSException
inputKeystrokes in class ComponentFunctionSAFSExceptionprotected java.awt.Rectangle getWindowRectangleOnScreen()
ComponentFunctiongetWindowRectangleOnScreen in class ComponentFunctionprotected java.awt.Rectangle getComponentRectangleOnScreen()
ComponentFunctiongetComponentRectangleOnScreen in class ComponentFunctionprotected java.awt.Rectangle getComponentRectangle()
ComponentFunctionComponentFunction.getRectangleImage(Rectangle) SHOULD be overridden in subclass to provide appropriate implementation.
ComponentFunction.deduceImageRect(String) to get a subarea rectangle.
getComponentRectangle in class ComponentFunctionComponentFunction.deduceImageRect(String)protected java.util.Collection<java.lang.String> captureObjectData()
throws SAFSException
captureObjectData in class ComponentFunctionSAFSException - "Not supported yet."protected java.util.Map<java.lang.String,java.lang.Object> getProperties()
throws SAFSException
getProperties in class ComponentFunctionSAFSException - "Not supported yet."protected java.lang.Object getPropertyObject(java.lang.String propertyName)
throws SAFSException
getPropertyObject in class ComponentFunctionSAFSException - "Not supported yet."protected void scrollToAndClickComponent(SGuiObject o)
o - component to be clickedprotected void scrollToComponent(SGuiObject o)
o - component to be scrolled toprotected java.awt.Rectangle getComponentBounds(java.lang.String s)
s - componentprotected boolean performHoverMouse(java.awt.Point point,
int milliseconds)
throws SAFSException
ComponentFunctionperformHoverMouse in class ComponentFunctionpoint - Point, coordinate relative to the component to hover at. null if hover the center.milliseconds - int, time to hover, in millisecondsSAFSExceptionCopyright © SAS Institute. All Rights Reserved.