org.safs
Class ComponentFunction
java.lang.Object
org.safs.Processor
org.safs.ComponentFunction
- Direct Known Subclasses:
- CFComponent, CFComponent, CFComponent, CFComponent, CFComponentFunctions, CFDefaultComponent, CFEditBox, CFTIDComponent, CFWindow
public abstract class ComponentFunction
- extends Processor
Purpose: abstract ComponentFunction, enforces that the 'process' method be implemented
- COMPONENT FUNCTIONS (so far...):
- CFButton
- CFCheckBox
- check
- Example: T,Frame,rememberPasswordCheckBox,check
- uncheck
- Example: TF,Frame,rememberPasswordCheckBox,uncheck
- CFComboBox
- selectIndex
- 1st param: index into the combobox of the item to select
- Example: T,Frame,nameComboComboBox,selectIndex,2
- select/selectTextItem/selectUnverified/selectUnverifiedTextItem
- 1st param: name of the item to select
- Example: T,Frame,nameComboComboBox,select,Karen Farrell
- setTextValue (not sure if this one actually works, does guiObj.setProperty("text", val);)
- 1st param: name of the item to select
- Example: T,Frame,nameComboComboBox,selectPartialMatch,Sammy The Fish
- showlist/hidelist - shows or hides the list
- Example: T,Frame,nameComboComboBox,showlist
- CFComponent (Available to nearly all components)
- click/rightClick
- Example: T,Frame,radioButtonARadioButton,click
- closeWindow/restore/minimize/maximize
- Example: T,Frame,radioButtonARadioButton,restore
- verifyProperty - verify that a property exists and exactly matches specified value
- 1st param: property name
- 2nd param: property value to verify against
- Example: TW,PlaceOrder,totalPriceLabel,VerifyProperty,text,$19.99
- verifyPropertyContains - verify that a property exists and contains specified value
- 1st param: property name
- 2nd param: property value to look for containment (substring of actual)
- Example: TW,PlaceOrder,totalPriceLabel,VerifyPropertyContains,text,19
- verifyValue - verify that a value exactly matches specified value
- 1st param: property name
- 2nd param: property value to verify against
- Example: TW,PlaceOrder,totalPriceLabel,VerifyValue,$19.99,^variable
- verifyValueContains - verify that a value contains specified value
- 1st param: property name
- 2nd param: property value to look for containment (substring of actual)
- Example: TW,PlaceOrder,totalPriceLabel,VerifyPropertyContains,^variable,$19
- clearAppMapCache - clear the cache of testobjects, normally not needed.
- Example: T,PlaceOrder,PlaceOrder,clearAppMapCache
- assignPropertyVariable - Assign the value of a cell to a variable
- 1st param: property name
- 2nd param: variablename
- Example: T,Frame,orderTableTable,assignPropertyVariable,text,var1
- Example: T,Frame,orderTableTable,assignPropertyVariable,text,var2
- Example: T,Frame,orderTableTable,assignPropertyVariable,text,var3
- inputKeys - input keys to the frame for the component
- 1st param: keys
- Example: T,PlaceOrder,_cardNumberFieldText,inputKeys,1234123412341234
- Example: T,PlaceOrder,_expireFieldText,inputKeys,09
- Example: T,PlaceOrder,_expireFieldText,inputKeys,/03
- VerifyObjectDataToFile, grab value(s) in "text" property, verify against file
- 1st param: file to verify against (in the bench directory)
- Example: T,PlaceOrder,PlaceOrder,VerifyObjectDataToFile,file.txt
- VerifyTextFileToFile, verify one file to another
- 1st param: file to verify against (in the bench directory)
- 2nd param: file to verify against (in the bench directory)
- Example: T,PlaceOrder,PlaceOrder,VerifyObjectDataToFile,file.txt
- CFLabel
- CFList (similar to combobox)
- activatetextitem
- activatepartialmatch
- activateunverifiedpartialmatch
- activateunverifiedtextitem
- select
- selectTextItem
- selectIndex
- selectPartialMatch
- verifymenupartialmatch - verify if a menu item exists (partial match)
- verifymenuitem - verify if a menu item exists
- verifypartialmatch - based on an index
- verifyitem - based on an index
- selectUnverifiedPartialMatch
- selectUnverified
- selectUnverifiedTextItem
- setTextValue
- CFMenuBar
- selectMenuItem
- selectMenuItemContains
- CFPageTabList
- click/clicktab
- 1st param: the tab to click
- Example: T,Frame,tabbedPanePageTabList,clicktab,Details
- selecttab/makeselection
- 1st param: the tab to select
- Example: T,Frame,tabbedPanePageTabList,selecttab,Details
- CFPopupMenu
- selectPopupMenuItem
- verifyPopupMenuItem
- 1st param: verify a popup menu item exists
- Example: T,Frame,popup,verifyPopupMenuItem,"Item"
- CFTable/CFJCTable (for Swing JTable, Sitraka JCTable respectively)
- clickCellOfColWithRowValues/doubleclickCellOfColWithRowValues - click or doubleclick a cell specified by the params (CFTable only)
- 1st param(opt): row;col coordinate within the cell, if omitted then the coords not used
- 2nd param: Column name of the cell to click on
- 3rd param: for a row, first column name of the row to click on
- 4th param: for a row, first cell value of the row to click on for this column
- 5th param(opt): for a row, second column name of the row to click on
- 6th param(opt): for a row, second cell value of the row to click on for this column
- 7th param(opt): for a row, third column name of the row to click on
- 8th param(opt): for a row, third cell value of the row to click on for this column
- Example: T,Frame,orderTableTable,clickCellOfColWithRowValues,,TOTAL,ORDERDATE,3/11/98,EXPDATE,1298,QUANTITY,3
- Example: T,Frame,orderTableTable,clickCellOfColWithRowValues,43;12,TOTAL,ORDERDATE,3/11/98,EXPDATE,1298,QUANTITY,3
- click/doubleclick/activatecell - click or doubleclick(activatecell) a cell specified by the params (from 1)
- 1st param: row;col row and column of the cell to click
- Example: T,Frame,orderTableTable,click,1;2
- selectRowWithRowValues - select a row specified by the params (CFTable only)
- 1st param: for a row, first column name of the row to click on
- 2nd param: for a row, first cell value of the row to click on for this column
- 3rd param(opt): for a row, second column name of the row to click on
- 4th param(opt): for a row, second cell value of the row to click on for this column
- 5th param(opt): for a row, third column name of the row to click on
- 6th param(opt): for a row, third cell value of the row to click on for this column
- Example: T,Frame,orderTableTable,selectRowWithRowValues,ORDERDATE,3/11/98,EXPDATE,1298,QUANTITY,3
- selectcell/selectcelltext - select a cell specified by the params (from 1)
- 1st param(opt): row;col row and column of the cell to select
- Example: T,Frame,orderTableTable,selectcell,3;4
- selectfuzzycelltext - fuzzy select a cell specified by the params (from 1)
- 1st param(opt): row;col row and column of the cell to select
- Example: T,Frame,orderTableTable,selectcell,3;4
- verifycelltext/verifyfuzzycelltext - verify the text of a cell
- 1st param: basevalue - value to compare against
- 2nd param(opt): row;col row and column of the cell to verify text
- 3rd param(opt): if included, the name of the column, in which case the col is ignored.
- Example: T,Frame,orderTableTable,verifyCellText,xyz
- Example: T,Frame,orderTableTable,verifyCellText,750 Central Expy,2;3
- Example: T,Frame,orderTableTable,verifyCellText,750 Central Expy,2,STREET
- verifycelltextcontains/verifyfuzzycelltextcontains - verify the text of a cell contains substring
- 1st param: basevalue - value to compare against (substring)
- 2nd param(opt): row;col row and column of the cell to verify text
- 3rd param(opt): if included, the name of the column, in which case the col is ignored.
- Example: T,Frame,orderTableTable,verifyCellTextContains,xy
- Example: T,Frame,orderTableTable,verifyCellTextContains,750 Central,2;3
- Example: T,Frame,orderTableTable,verifyCellTextContains,50 Cen,2,STREET
- assignVariableCellText/assignVariableFuzzyCellText - Assign the value of a cell to a variable
- 1st param: variablename
- 2nd param(opt): row;col row and column of the cell get text from
- 3rd param(opt): if included, the name of the column, in which case the col is ignored.
- Example: T,Frame,orderTableTable,assignVariableCellText,var1
- Example: T,Frame,orderTableTable,assignVariableCellText,var2,2;3
- Example: T,Frame,orderTableTable,assignVariableCellText,var3,2,STREET
- captureRangeToFile/captureFuzzyRangeToFile - capture range to file
- 1st param: variablename
- 2nd param(opt): startRow
- 3rd param(opt): startCol
- 4rt param(opt): numRows
- 5th param(opt): nujCols
- Example: T, JavaWin, JTable, CaptureRangeToFile, AFileName.txt
- Example: T, JavaWin, JTable, CaptureRangeToFile, AFileName.txt, 4, "Field5", 2, 5
- CFText
- setTextValue
- 1st param: the text to set in the text value
- Example: T,Frame,_expireFieldText,SetTextValue,12/03
- CFTree
- click
- 1st param: the node of the tree to click
- Example: T,Frame,tree2Tree,click,Composers->Bach->Brandenburg Concertos Nos. 1 & 3
- doubleclick
- 1st param: the node of the tree to doubleclick
- Example: T,Frame,tree2Tree,doubleclick,Composers->Bach
- select/makeselection/selecttextnode/selectpartialtextnode
- 1st param: the node of the tree to select
- Example: T,Frame,tree2Tree,select,Composers->Bach->Violin Concertos
- expand/expandtextnode/expandpartialtextnode
- 1st param: the node of the tree to expand
- Example: T,Frame,tree2Tree,expand,Composers->Schubert
- collapse/collapsetextnode/collapsepartialtextnode
- 1st param: the node of the tree to collapse
- Example: T,Frame,tree2Tree,collapse,Composers->Haydn
- Since:
- JUN 04, 2003
JUN 04, 2003 (DBauman) Original Release
SEP 16, 2003 (CANAGL) Implemented use of new SAFSLOGS logging.
NOV 10, 2003 (CANAGL) Added isSupportedRecordType() implementation.
OCT 28, 2005 (CANAGL) Refactored to allow for override of convertCoords methods.
MAR 19, 2008 (LeiWang) Added componentSuccessMessage for common success message use.
MAR 25, 2008 (JuwnuMa) Added componentExecutedFailureMessage
DEC 03, 2008 (LeiWang) Modify method action_getGuiImage() and action_verifyGuiImageToFile():
Call ImageUtils.saveImageToFile() to save image, instead of ImageIO.write();
Because using ImageIO.write() will loss quality of jpg image. Now we use full
quality to save jpg image, that is when call ImageUtils.saveImageToFile(), we
set its third parameter to 1.0f
MAR 25, 2009 (CANAGL) Added issuePassedSuccessUsing
NOV 12, 2009 (CANAGL) Simple JavaDoc update
APR 14, 2010 (JunwuMa)Move TIDComponent.setRectVars() to ComponentFunction for sharing.
| 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, 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, 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, WARNING_MESSAGE, WARNING_OK_MESSAGE, warningStr, warningText |
|
Method Summary |
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 void |
componentExecutedFailureMessage(java.lang.String detail)
"windowname compName action processed with a negative result."
"[detail]"
Purpose: log a simple failure message when a test record got processed with negative result. |
protected void |
componentFailureMessage(java.lang.String detail)
"Unable to perform action on compName in file line N."
"[Detail]"
Purpose: log an "Unable to perform function" FAILED_MESSAGE with detail. |
protected void |
componentSuccessMessage(java.lang.String detail)
"windowName compName action successful."
"[detail]"
Purpose: Log a generic success message. |
java.awt.Point |
convertCoords(java.lang.String coords)
Convert coordinates string of the formats:
"x;y"
"x,y"
"x y"
"Coords=x;y"
"Coords=x,y"
"Coords=x y"
into a java.awt.Point object. |
java.awt.Polygon |
convertLine(java.lang.String coords)
Convert 2-point Line coordinates string of the formats:
"x1;y1;x2;y2"
"x1,y1,x2,y2"
"x1 y1 x2 y2"
"Coords=x1;y1;x2;y2"
"Coords=x1,y1,x2,y2"
"Coords=x1 y1 x2 y2"
into a java.awt.Polygon object. |
java.lang.Integer |
convertNum(java.lang.String num)
Purpose: convertNum: convert into a number
Assumptions: all exceptions are handled. |
java.util.Collection |
getAlternateParams()
Purpose: zero-based params with:
windowname
compname
+N additional parameters
|
protected java.awt.Rectangle |
getComponentRectangle()
Do nothing method returns null. |
protected void |
getHelpers()
Simply calls getHelpersWorker. |
protected void |
getHelpersWorker()
set instance variables from the current testRecordData:
actionwindowNamecompNamemapnameutils
Subclasses can override this for any additional setup beyond getHelpersWorker. |
protected void |
issueActionFailure(java.lang.String error)
"Unable to perform action. |
protected void |
issueActionOnXFailure(java.lang.String x,
java.lang.String error)
"Unable to perform action on [x]. |
protected void |
issueErrorPerformingAction(java.lang.String error)
"Error performing action. |
protected void |
issueErrorPerformingActionOnX(java.lang.String x,
java.lang.String error)
Sets GENERAL_SCRIPT_FAILURE and issues a FAILED_MESSAGE:
"Error performing action on [x]. |
protected void |
issueFileErrorFailure(java.lang.String filename)
Issue a file error and failure message
Filename does not need to be localized. |
protected void |
issueInputRecordFailure(java.lang.String error)
"Unable to perform action. |
protected void |
issueParameterCountFailure()
Issue parameter count error and failure message |
protected void |
issueParameterCountFailure(java.lang.String detail)
Issue parameter count error and failure message |
protected void |
issueParameterValueFailure(java.lang.String paramName)
Issue parameter value error and failure message |
protected void |
issuePassedSuccess(java.lang.String comment)
"windowName compName action successful. |
protected void |
issuePassedSuccessUsing(java.lang.String using)
"windowName compName action successful using [using]"
Sets status to OK and issues a PASSED message. |
protected void |
issueUnknownErrorFailure(java.lang.String cause)
Issue a generic error and failure message
The cause parameter is expected to already be localized. |
boolean |
isSupportedRecordType(java.lang.String recordType)
Supports standard TEST STEP record types (T, TW, TF) |
protected java.awt.Point |
lookupAppMapCoordReference(java.lang.String referenceName)
lookupAppMapCoordReference: uses 'convertCoords'
after the call to 'lookupAppMapReference'. |
protected java.awt.Polygon |
lookupAppMapLineReference(java.lang.String referenceName)
lookupAppMapLineReference: uses 'convertLine'
after the call to 'lookupAppMapReference'. |
protected java.lang.Integer |
lookupAppMapNumReference(java.lang.String referenceName)
Purpose: lookupAppMapNumReference: uses 'convertNum'
after the call to 'lookupAppMapReference'. |
protected java.lang.String |
lookupAppMapReference(java.lang.String referenceName)
Looks up an item using the current appmapID=mapname, section=compName, item=referenceName. |
protected boolean |
setRectVars(java.awt.Rectangle rect,
java.lang.String varname)
Set the varname.x, varname.y, varname.w, and varname.h variables to the
values retrieved from the rectangle. |
protected void |
updateFromTestRecordData()
Updates our internal storage for action, windowName, compName, and mapname from
the current TestRecordData. |
| 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, isRFSMCache, isRFSMOnly, paramsFailedMsg, paramsFailedMsg, process, processCustomProcessor, processSubclassProcessor, setBreakpointsOn, setChainedProcessor, setClearProxiesAlways, setCommandLineBreakpoint, setCustomProcInstancePath, setLogUtilities, setMyBreakpointsOn, setParams, setProcInstance, setProcInstancePath, setRecordProcessed, setRFSMCache, setRFSMOnly, 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 |
action
protected java.lang.String action
windowName
protected java.lang.String windowName
compName
protected java.lang.String compName
mapname
protected java.lang.String mapname
utils
protected DDGUIUtilities utils
ComponentFunction
public ComponentFunction()
Purpose: constructor
updateFromTestRecordData
protected void updateFromTestRecordData()
- Updates our internal storage for action, windowName, compName, and mapname from
the current TestRecordData. Missing items in the TestRecordData will update our
storage with null.
isSupportedRecordType
public boolean isSupportedRecordType(java.lang.String recordType)
- Supports standard TEST STEP record types (T, TW, TF)
- Specified by:
isSupportedRecordType in class Processor
- Parameters:
recordType - -- String text of record type to match (ignoring case).
- Returns:
- 'true' if the provided recordType is one this Processor can execute.
Note, that SAFS record types are normally not case-sensitive. So the
comparison to match the provided recordType should ignore case.
getAlternateParams
public java.util.Collection getAlternateParams()
Purpose: zero-based params with:
- windowname
- compname
- +N additional parameters
- Overrides:
getAlternateParams in class Processor
- Returns:
- Collection
getHelpersWorker
protected void getHelpersWorker()
throws SAFSException
- set instance variables from the current testRecordData:
- action
- windowName
- compName
- mapname
- utils
Subclasses can override this for any additional setup beyond getHelpersWorker.
- Throws:
SAFSException
getHelpers
protected void getHelpers()
throws SAFSException
- Simply calls getHelpersWorker.
Subclasses can override this for any additional setup beyond getHelpersWorker.
- Throws:
SAFSException
convertNum
public java.lang.Integer convertNum(java.lang.String num)
Purpose: convertNum: convert into a number
Assumptions: all exceptions are handled.
- Parameters:
numStr, - String
(indexed from 1, 1 will be subtracted from the number before returned)
- Returns:
- Integer if successfull, null otherwise (if alpha chars instead
of digits are encountered; or if number is less than one)
convertCoords
public java.awt.Point convertCoords(java.lang.String coords)
- Convert coordinates string of the formats:
- "x;y"
- "x,y"
- "x y"
- "Coords=x;y"
- "Coords=x,y"
- "Coords=x y"
into a java.awt.Point object.
Subclasses may override to convert alternative values, such
as Row and Col values as is done in org.safs.rational.CFTable
- Parameters:
coords, - String x;y or x,y or Coords=x;y or Coords=x,y
- Returns:
- Point if successfull, null otherwise
convertLine
public java.awt.Polygon convertLine(java.lang.String coords)
- Convert 2-point Line coordinates string of the formats:
- "x1;y1;x2;y2"
- "x1,y1,x2,y2"
- "x1 y1 x2 y2"
- "Coords=x1;y1;x2;y2"
- "Coords=x1,y1,x2,y2"
- "Coords=x1 y1 x2 y2"
into a java.awt.Polygon object.
- Parameters:
coords, - String x1;y1;x2;y2 or x1,y1,x2,y2 or Coords=x1;y1;x2;y2 or Coords=x1,y1,x2,y2
- Returns:
- Polygon if successfull, null otherwise
lookupAppMapReference
protected java.lang.String lookupAppMapReference(java.lang.String referenceName)
- Looks up an item using the current appmapID=mapname, section=compName, item=referenceName.
mapname and compName are expected to already be set from prior command processing.
- Parameters:
referenceName -
- Returns:
- retrieved value or null
lookupAppMapCoordReference
protected java.awt.Point lookupAppMapCoordReference(java.lang.String referenceName)
- lookupAppMapCoordReference: uses 'convertCoords'
after the call to 'lookupAppMapReference'.
- Parameters:
referenceName, - String, the reference name passed on to
method 'lookupAppMapReference' to lookup the coordinate string
from an AppMap. Then that value is passed on to convertCoords.
- Returns:
- Point if successfull, null otherwise (if alpha chars instead
of digits are encountered; or if row or col less than one)
lookupAppMapLineReference
protected java.awt.Polygon lookupAppMapLineReference(java.lang.String referenceName)
- lookupAppMapLineReference: uses 'convertLine'
after the call to 'lookupAppMapReference'.
- Parameters:
referenceName, - String, the reference name passed on to
method 'lookupAppMapReference' to lookup the Line string
from an AppMap. Then that value is passed on to convertLine.
- Returns:
- Polygon if successfull, null otherwise (if alpha chars instead
of digits are encountered; or if less than 2 points are detected.)
lookupAppMapNumReference
protected java.lang.Integer lookupAppMapNumReference(java.lang.String referenceName)
Purpose: lookupAppMapNumReference: uses 'convertNum'
after the call to 'lookupAppMapReference'.
- Parameters:
referenceName, - String, the reference name passed on to
method 'lookupAppMapReference' to lookup the number string from an AppMap. Then that
value is passed on to convertNum.
- Returns:
- Integer if successfull, null otherwise (if alpha chars instead
of digits are encountered; or if index is less than one)
componentFailureMessage
protected void componentFailureMessage(java.lang.String detail)
- "Unable to perform action on compName in file line N."
"[Detail]"
Purpose: log an "Unable to perform function" FAILED_MESSAGE with detail.
Expects testRecordData to already have filename, lineNumber, compName, and command.
componentSuccessMessage
protected void componentSuccessMessage(java.lang.String detail)
- "windowName compName action successful."
"[detail]"
Purpose: Log a generic success message.
componentExecutedFailureMessage
protected void componentExecutedFailureMessage(java.lang.String detail)
- "windowname compName action processed with a negative result."
"[detail]"
Purpose: log a simple failure message when a test record got processed with negative result. When an
action intends to make a judgment, a negative result is gotten if the logical result of the judgment
is false; the test step will be logged as 'FAIL' although it got executed correctly. Called by some comparing actions.
E.g. When doing verifyCaptureText, the result is negative if the body test captured doesn't match the bench mark file.
* @param detail -- a detail message
issuePassedSuccess
protected void issuePassedSuccess(java.lang.String comment)
- "windowName compName action successful. [comment]"
Sets status to OK and issues a PASSED message.
string comment is expected to already be localized.
issuePassedSuccessUsing
protected void issuePassedSuccessUsing(java.lang.String using)
- "windowName compName action successful using [using]"
Sets status to OK and issues a PASSED message.
string comment is expected to already be localized, if necessary.
issueInputRecordFailure
protected void issueInputRecordFailure(java.lang.String error)
- "Unable to perform action. [error]"
"Details + inputrecord"
Sets status to FAILURE and issues a FAILED message.
called by other issueFailure routines
issueActionFailure
protected void issueActionFailure(java.lang.String error)
- "Unable to perform action. [error].
"Details + [error]"
Sets status to FAILURE and issues a FAILED message.
called by other issueFailure routines
issueActionOnXFailure
protected void issueActionOnXFailure(java.lang.String x,
java.lang.String error)
- "Unable to perform action on [x]. [error]."
"Details + [error]"
Sets status to FAILURE and issues a FAILED message.
issueErrorPerformingAction
protected void issueErrorPerformingAction(java.lang.String error)
- "Error performing action. [error]"
"Details + [error]"
issueErrorPerformingActionOnX
protected void issueErrorPerformingActionOnX(java.lang.String x,
java.lang.String error)
- Sets GENERAL_SCRIPT_FAILURE and issues a FAILED_MESSAGE:
"Error performing action on [x]. [error]"
"Details + [error]"
issueParameterCountFailure
protected void issueParameterCountFailure()
- Issue parameter count error and failure message
issueParameterCountFailure
protected void issueParameterCountFailure(java.lang.String detail)
- Issue parameter count error and failure message
- Parameters:
detail - detail about specific missing params or command format
issueParameterValueFailure
protected void issueParameterValueFailure(java.lang.String paramName)
- Issue parameter value error and failure message
- Parameters:
paramName - -- the Name of the action parameter in error.
issueFileErrorFailure
protected void issueFileErrorFailure(java.lang.String filename)
- Issue a file error and failure message
Filename does not need to be localized.
issueUnknownErrorFailure
protected void issueUnknownErrorFailure(java.lang.String cause)
- Issue a generic error and failure message
The cause parameter is expected to already be localized.
getComponentRectangle
protected java.awt.Rectangle getComponentRectangle()
- Do nothing method returns null.
Subclasses should override to provide the true Rectangle
bounds of the Component currently represented in the current testRecordData.
Subclasses should assume the mapname, windowName, and compName currently stored
for the instance hold the information needed to identify and locate the Component
on the screen or in the system.
- Returns:
- Rectangle bounds of the Component or null. If null is received the class
assumes relevant error logging and testRecordData.statuscode changes have already
been performed.
action_getGuiImage
protected void action_getGuiImage()
throws SAFSException
- Processes a Component Function Test Record to capture a screen GUI image to a file.
Currently, the available formats for the output file are JPG, BMP, TIF, GIF, PNG and PNM.
Optionally, the user may utilize the SubArea parameter to only capture a portion of the Component.
This routine expects to be called by subclasses only and the subclass must override
the getComponentRectangle method to provide the necessary location of the
desired Component. Subclasses must also have already set the fields for mapname,
windowName, compName, and action. This is usually already done in the process() call
from the subclasses.
This routine utilizes Java Advanced Imaging (JAI) to output the screen image to the file.
JAI must be installed at compile time and runtime.
- Throws:
SAFSException
action_verifyGuiImageToFile
protected void action_verifyGuiImageToFile()
throws SAFSException
- Processes a Component Function Test Record to verify a screen GUI image to a file.
Currently, the available formats for the output file are BMP and JPG.
Optionally, the user may utilize the SubArea parameter to only capture a portion of the Component.
This routine expects to be called by subclasses only and the subclass must override
the getComponentRectangle method to provide the necessary location of the
desired Component. Subclasses must also have already set the fields for mapname,
windowName, compName, and action. This is usually already done in the process() call
from the subclasses.
This routine utilizes Java Advanced Imaging (JAI) to output the screen image to the file.
JAI must be installed at compile time and runtime.
- Throws:
SAFSException
setRectVars
protected boolean setRectVars(java.awt.Rectangle rect,
java.lang.String varname)
- Set the varname.x, varname.y, varname.w, and varname.h variables to the
values retrieved from the rectangle.
- Parameters:
loc - varname -
- Returns: