public class CFComponent extends ComponentFunction
ComponentFunction.Window
Modifier and Type | Field and Description |
---|---|
protected boolean |
keepEncodingConsistent
Keywords like CaptureXXXXX, will write file with different encoding before.
To keep them consistent, we let them to use the same default encoding But this will affect the old test, this option is used to tell if we use consistent encoding for these keywords Default, we should let it as true to use consistent encoding. See defect S0751446. |
protected TestObject |
obj1 |
protected Script |
script |
protected TestObject |
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, windowName
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, 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()
Purpose: constructor, calls super |
Modifier and Type | Method and Description |
---|---|
protected void |
_maximize()
Purpose: maximize |
protected void |
_minimize()
Purpose: minimize |
protected void |
_restore()
Purpose: restore |
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 java.util.List |
captureObjectData(TestObject table)
Captures the object data into a List.
|
protected void |
captureObjectDataToFile()
A generic implementation for CaptureObjectDataToFile.
|
protected void |
capturePropertiesToFile()
Purpose: capturePropertiesToFile |
protected void |
capturePropertyToFile()
Purpose: capturePropertyToFile Note: for now, the value of the parameter is meaningless because the value of the property inferrs if it is an array or not. |
protected void |
clearAppMapCache()
Purpose: clearAppMapCache |
protected void |
closeWindow()
Purpose: closeWindow |
protected void |
componentClick()
Checks for optional coords parameter and then routes to performClick.
|
protected java.lang.String |
convertObjectValueToString(java.lang.Object value)
Given an object of any type attempt to convert or extract its intended or
visible text value.
|
protected boolean |
exist()
To test if the component exists or not.
The sub class may test the component's visibility also. |
protected Tree |
extractTreeItemsSub(java.lang.Object nitem)
Extract a 'Tree' hierarchy from a TestObject.
|
protected TestObject[] |
findMenuBars(TestObject guiObj)
Note: Only java-swing and .NET are supported.
|
protected java.lang.String |
formatObjectData(java.util.List list)
Format the List data into a single String.
|
protected TopLevelTestObject |
getAppletsBrowser(GuiTestObject guiObj)
getParentBrowser
Given a component assumed to be inside an Applet, we will attempt to
locate the TopLevelTestObject in the "Html" domain that has the
containing Java Plug-in object overlapping the same screen location.
|
protected java.awt.Rectangle |
getComponentRectangle()
Return the component's screen bounds.
|
protected java.awt.Rectangle |
getComponentRectangleOnScreen()
Return the component's screen bounds.
|
protected void |
getHelpers()
Simply calls getHelpersWorker.
|
boolean |
getKeepEncodingConsistent() |
protected java.lang.Object |
getObjectProperty(TestObject o,
java.lang.String prop)
get the RFT value of a property or an indexed property as in rowLabel(0)
|
protected java.lang.Object |
getObjectPropertyFromProperties(TestObject o,
java.lang.String prop)
Attempt to extract a property value from the Hashtable provided from getProperties().
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getProperties() |
protected java.lang.Object |
getPropertyObject(java.lang.String propertyName) |
protected java.lang.Object |
getUserObject(java.lang.Object obj,
java.lang.Integer level)
Purpose: getUserObject, should be overridden by children. |
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 static boolean |
isDotnetDomain(TestObject tobj) |
protected static boolean |
isFlexDomain(TestObject tobj) |
protected static boolean |
isHtmlDomain(TestObject tobj) |
protected static boolean |
isJavaDomain(TestObject tobj) |
protected static boolean |
isSwtDomain(TestObject tobj) |
protected boolean |
isSWTWidget(TestObject theobj)
Determine if the TestObject is an Eclipse SWT component.
|
protected static boolean |
isWinDomain(TestObject tobj) |
protected void |
listAllProperties(TestObject obj)
Purpose: list all TestObject properties, using listProperties and listNonValueProperties |
protected void |
listAllProperties(TestObject obj,
java.lang.String str)
Purpose: list all TestObject properties, using listProperties and listNonValueProperties |
protected void |
listMethods(TestObject obj)
Purpose: list TestObject methods |
protected void |
listNonValueProperties(TestObject obj)
Purpose: list 'non-value' TestObject properties |
protected void |
listProperties(TestObject obj)
Purpose: list 'regular' TestObject properties |
protected void |
localProcess()
no implementation, just here so that our children know the 'protected' interface
|
protected java.lang.String |
matchedPathOfMenuItem(GuiTestObject guiObj,
java.lang.String path,
boolean fuzzy,
java.lang.String status)
Note: guiObj is a GuiSubitemTestObject in Java or DotNet domains; a FlexMenuBarTestObject in Flex domain.
|
protected void |
mouseClick(GuiTestObject gto,
java.awt.Point clickPoint)
Attempt to click an object by mouse event.
|
protected java.lang.Object |
parseWhereInfo(java.lang.String whereinfo)
Parse a string to determine 'where' something should happen on a given component.
|
protected void |
performClick(java.lang.Object point)
Perform a standard Click, RightClick, or DoubleClick on the component.
|
protected void |
performDrag()
perform LeftDrag or RightDrag on component moving from (x1,y1) to (x2,y2).
|
protected boolean |
performHoverMouse(java.awt.Point point,
int miliseconds)
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. |
protected void |
performScorll()
Purpose: Drag a compenent horizontally or vertically Note: If TestObject 'obj1' represent a GuiSubitemTestObject, then use the RFT API setState method; This method will consider the position as a relative value. |
void |
process()
Purpose: do the processing. |
protected void |
selectMenuItem(boolean fuzzy)
perform SelectMenuItem and SelectMenuItemContains
|
protected void |
sendEvent()
send an event to the object--assuming it supports receiving events.
|
protected void |
sendFlexEvent()
called from sendEvent for Flex Domain sendEvent handling.
|
void |
setKeepEncodingConsistent() |
protected void |
setPropertyValue()
Purpose: setPropertyValue Note: Log the original value the the property; Set the new value to this property. |
protected Tree |
tobj(TestObject nitem)
Purpose: extract a 'Tree' hierarchy from a TestObject using recursion; The item is for JTree node. |
protected void |
verifyClipboardToFile()
Purpose: verifyClipboardToFile |
protected void |
verifyFileToFile(boolean text)
Purpose: verifyFileToFile |
protected void |
verifyMenuItem(boolean fuzzy)
perform actions for keywords verifyMenuItem and verifyMenuItemContains
|
protected void |
verifyObjectDataToFile()
Purpose: verifyObjectDataToFile |
protected void |
verifyPropertyContains()
Purpose: verifyPropertyContains |
protected void |
verifyPropertyToFile(boolean array)
Purpose: verifyArrayPropertyToFile/verifyPropertyToFile |
protected void |
verifyValueContains()
Purpose: verifyValueContains |
protected void |
verifyValues()
Purpose: verifyValues, verifyValuesIgnoreCase, verifyValueEquals |
_close, action_ComputedStyle, action_getGuiImage, action_GetSaveTextFromGUI, action_showOnPage, action_verifyGuiImageToFile, assignPropertyVariable, captureObjectData, checkForCoord, checkForCoord, clearCache, close, componentExecutedFailureMessage, componentFailureMessage, componentProcess, componentSuccessMessage, convertCoords, convertLine, convertNum, convertWindowPosition, ConvertWindowPosition, deduceImageRect, dragTo, executeScript, getAlternateParams, 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, maximize, minimize, normalizeFileEncoding, normalizePropertyCollection, restore, setIterator, setPosition, setRectVars, showComponentAsMuchPossible, updateFromTestRecordData, verifyPropertiesToFile, verifyProperty, waitForGUI, waitForObject
activateBreakpoint, 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, validProcessorClassName
protected Script script
protected TestObject winObject
protected TestObject obj1
protected boolean keepEncodingConsistent
public void setKeepEncodingConsistent()
public boolean getKeepEncodingConsistent()
protected void getHelpers() throws SAFSException
ComponentFunction
getHelpers
in class ComponentFunction
SAFSException
public void process()
protected void localProcess()
protected java.lang.Object parseWhereInfo(java.lang.String whereinfo)
Supported formats of whereinfo:
whereinfo
- String usually retrieved from the test table.protected void sendFlexEvent()
protected void sendEvent() throws SAFSException
In general, the command as initially implemented for Flex expects there to be an event name followed by 0 or more parameters. These parameters will be different and defined by the event or technology.
sendEvent
in class ComponentFunction
SAFSException
protected void selectMenuItem(boolean fuzzy) throws SAFSException
selectMenuItem
in class ComponentFunction
fuzzy,
- false: select the menu item that exactly matches the gaven pathSAFSException
protected void verifyMenuItem(boolean fuzzy) throws SAFSException
verifyMenuItem
in class ComponentFunction
fuzzy,
- to do exactly match if false, otherwise do fuzzy matchSAFSException
protected void performDrag() throws SAFSException
performDrag
in class ComponentFunction
SAFSException
protected java.lang.String matchedPathOfMenuItem(GuiTestObject guiObj, java.lang.String path, boolean fuzzy, java.lang.String status) throws SAFSException
SAFSException
protected TestObject[] findMenuBars(TestObject guiObj)
guiObj
- A test object represents an application window from which
we try to get menu bars.protected void componentClick()
componentClick
in class ComponentFunction
protected void performClick(java.lang.Object point)
point
- java.awt.Point x,y coords relative to the component or null.protected void closeWindow()
closeWindow
in class ComponentFunction
protected void _restore() throws SAFSException
_restore
in class ComponentFunction
SAFSException
protected void _setPosition(java.awt.Point position) throws SAFSException
ComponentFunction
_setPosition
in class ComponentFunction
SAFSException
protected void _setSize(java.awt.Dimension size) throws SAFSException
ComponentFunction
_setSize
in class ComponentFunction
SAFSException
protected void _minimize() throws SAFSException
_minimize
in class ComponentFunction
SAFSException
protected void _maximize() throws SAFSException
_maximize
in class ComponentFunction
SAFSException
protected void mouseClick(GuiTestObject gto, java.awt.Point clickPoint)
gto
- - GuiTestObjectclickPoint
- - Point as location, default centerprotected java.lang.Object getObjectPropertyFromProperties(TestObject o, java.lang.String prop)
o
- - TestObject to get property fromprop
- - property to seekprotected java.lang.Object getObjectProperty(TestObject o, java.lang.String prop) throws PropertyNotFoundException
o
- - TestObject to get property fromprop
- - property to seek, can be an indexed property like rowLabel(0)PropertyNotFoundException
protected void verifyPropertyContains() throws SAFSException
verifyPropertyContains
in class ComponentFunction
SAFSException
protected void verifyValueContains() throws SAFSException
verifyValueContains
in class ComponentFunction
SAFSException
protected void verifyValues() throws SAFSException
verifyValues
in class ComponentFunction
SAFSException
protected java.util.Map<java.lang.String,java.lang.Object> getProperties() throws SAFSException
getProperties
in class ComponentFunction
SAFSException
- "Not supported yet."protected java.lang.Object getPropertyObject(java.lang.String propertyName) throws SAFSException
getPropertyObject
in class ComponentFunction
SAFSException
- "Not supported yet."protected void clearAppMapCache()
clearAppMapCache
in class ComponentFunction
protected void inputKeystrokes() throws SAFSException
inputKeystrokes
in class ComponentFunction
SAFSException
protected void verifyObjectDataToFile() throws SAFSException
verifyObjectDataToFile
in class ComponentFunction
SAFSException
protected java.lang.String convertObjectValueToString(java.lang.Object value) throws SAFSException
value
- String or TestObject to get the text fromSAFSException
RGuiObjectRecognition.getText(TestObject)
protected java.util.List captureObjectData(TestObject table) throws java.lang.IllegalArgumentException, SAFSException
table
- TestObject to snapshot data from.SAFSException
java.lang.IllegalArgumentException
- if table is not an acceptable TestObject.protected java.lang.String formatObjectData(java.util.List list) throws java.lang.IllegalArgumentException
In this implementation the List is expected to be a single Object provided by captureObjectData. This Object has typically been a Rational NameSet of Strings, a Java Collection of Strings, or a simple Object on which we use toString().
Each final item(s) in the List will be output using the toString().trim() method.
It is expected the data is ready for writing to a file or other similar use without further modification.
list
- List returned from captureObjectDatajava.lang.IllegalArgumentException
- if the List or the Object extracted from the List are null.captureObjectData(TestObject)
protected boolean performHoverMouse(java.awt.Point point, int miliseconds) throws SAFSException
ComponentFunction
performHoverMouse
in class ComponentFunction
point
- Point, coordinate relative to the component to hover at. null if hover the center.miliseconds
- int, time to hover, in millisecondsSAFSException
protected void captureObjectDataToFile() throws SAFSException
captureObjectDataToFile
in class ComponentFunction
SAFSException
captureObjectData(TestObject)
,
formatObjectData(java.util.List)
protected void capturePropertiesToFile() throws SAFSException
capturePropertiesToFile
in class ComponentFunction
SAFSException
protected void verifyFileToFile(boolean text) throws SAFSException
verifyFileToFile
in class ComponentFunction
text,
- boolean, if true, then text files, else binary filesSAFSException
protected java.awt.Rectangle getWindowRectangleOnScreen()
ComponentFunction
getWindowRectangleOnScreen
in class ComponentFunction
protected java.awt.Rectangle getComponentRectangleOnScreen()
getComponentRectangleOnScreen
in class ComponentFunction
protected java.awt.Rectangle getComponentRectangle()
getComponentRectangle
in class ComponentFunction
ComponentFunction.deduceImageRect(String)
protected boolean exist() throws SAFSException
ComponentFunction
exist
in class ComponentFunction
SAFSException
protected void verifyPropertyToFile(boolean array) throws SAFSException
verifyPropertyToFile
in class ComponentFunction
array,
- boolean, if true, then array property, else scalar
SAFSException
protected void capturePropertyToFile() throws SAFSException
capturePropertyToFile
in class ComponentFunction
SAFSException
protected void verifyClipboardToFile() throws SAFSException
verifyClipboardToFile
in class ComponentFunction
SAFSException
protected void setPropertyValue()
setPropertyValue
in class ComponentFunction
protected void performScorll() throws SAFSException
performScorll
in class ComponentFunction
SAFSException
protected void listAllProperties(TestObject obj)
obj,
- TestObjectprotected void listAllProperties(TestObject obj, java.lang.String str)
obj,
- TestObjectstr,
- String, used in the header of the listprotected void listProperties(TestObject obj)
obj,
- TestObjectprotected void listNonValueProperties(TestObject obj)
obj,
- TestObjectprotected void listMethods(TestObject obj)
obj,
- TestObjectprotected Tree extractTreeItemsSub(java.lang.Object nitem) throws SAFSException
nitem,
- TestObject, the next itemSAFSException
protected Tree tobj(TestObject nitem) throws java.lang.Exception
obj,
- Object (actually of type GuiSubitemTestObject)java.lang.Exception
protected java.lang.Object getUserObject(java.lang.Object obj, java.lang.Integer level)
obj,
- Object objlevel,
- Integerprotected boolean isSWTWidget(TestObject theobj)
theobj,
- TestObject reference to GUI componentprotected TopLevelTestObject getAppletsBrowser(GuiTestObject guiObj)
GuiTestObject
- component assumed to be inside a browser applet.protected static boolean isJavaDomain(TestObject tobj)
protected static boolean isDotnetDomain(TestObject tobj)
protected static boolean isHtmlDomain(TestObject tobj)
protected static boolean isWinDomain(TestObject tobj)
protected static boolean isSwtDomain(TestObject tobj)
protected static boolean isFlexDomain(TestObject tobj)
Copyright © SAS Institute. All Rights Reserved.