public class TestStepProcessor extends Processor
Modifier and Type | Field and Description |
---|---|
protected static boolean |
cfBreakpointsOn
All instances may enable/disable and force breakpoints where they
deem this appropriate.
|
static java.lang.String |
DEFAULT_TEST_STEP_CLASSNAME
DEFAULT_TEST_STEP_PREFIX +"Component"
Short classname appended to alternative/custom package names.
|
static java.lang.String |
DEFAULT_TEST_STEP_PREFIX
"CF"
Default prefix for short classname for test step processors.
|
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 |
---|
TestStepProcessor()
Purpose: constructor, calls super |
Modifier and Type | Method and Description |
---|---|
protected void |
checkMyBreakpoints(java.lang.String breakpoint_message)
test for enabled CF-specific breakpoints in addition to the standard
Processor breakpoints.
|
protected void |
componentFailureMessage(java.lang.String detail)
Purpose: log a standard component function FAILED_MESSAGE with detail. |
protected void |
componentWarningMessage(java.lang.String detail)
Purpose: log a standard component function WARNING_MESSAGE with detail. |
protected java.lang.String |
getComponentProcClassName()
Assumes the stored procInstancePath identifies a package name in which to locate the
"CFComponent" class.
|
java.util.ArrayList |
getCustomProcClassNames()
Overrides Processor.getCustomProcClassName
Calls the super method to first see if the user has already specified a full path
name for any custom Driver Command Processor.
|
java.util.ArrayList |
getProcClassNames()
Overrides Processor.getProcClassNames
Calls the super method to first see if the user has already specified a full path
name for the Test Step Processor.
|
protected boolean |
getWinAndCompGUIObjects()
Called internally or overridden by subclasses to find the windowObject and compObjects.
|
protected boolean |
instantiateComponentFunction(java.util.Collection params)
Purpose: This is where we call the component functions declared at the top in the ComponentFunctions DECLARATION section. |
protected java.util.Collection |
interpretFields()
Purpose: Interprets the fields of the test record and puts the appropriate values into the fields of testRecordData. |
static boolean |
isCFBreakpointsOn()
test if CF-specific breakpoints are enabled.
|
boolean |
isSupportedRecordType(java.lang.String recordType)
Supports standard TEST STEP record types (T, TW, TF)
|
protected void |
postProcess()
A place to perform operations AFTER we have finished processing the record
but before we return from the process function.
|
void |
process()
Purpose: process: process the testRecordData |
protected boolean |
setActiveWindow()
Note: This method will make the top window to become the active window. |
static void |
setCFBreakpointsOn(boolean enabled)
This may be set by any means.
|
protected int |
waitForObject(boolean isWindow)
Wait for the window/component occur.
|
protected boolean |
waitForObjectAndCheck(boolean isWindow)
Wait for the window/component to occur, and check if window/component can be found or not.
If the window/component can not be found: if there are more engines available then log warning and set status-code to "NotExecuted". if the return-code of waitForObject() is 'SCRIPT_NOT_EXECUTED' then set status-code to "NotExecuted" so that more engine will be tried. otherwise log error and set status-code to "Failure". |
activateBreakpoint, checkBreakpoints, deduceBenchFile, deduceDiffFile, deduceProjectFile, deduceTestFile, delay, distributeConfigInformation, getAbsolutFileName, getAlternateParams, getAppMapItem, getChainedProcessor, getClassInstance, getClearProxiesAlways, getCustomProcInstancePath, getLogUtilities, getParams, 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
public static final java.lang.String DEFAULT_TEST_STEP_PREFIX
public static final java.lang.String DEFAULT_TEST_STEP_CLASSNAME
protected static boolean cfBreakpointsOn
public static void setCFBreakpointsOn(boolean enabled)
public static boolean isCFBreakpointsOn()
protected void checkMyBreakpoints(java.lang.String breakpoint_message)
checkMyBreakpoints
in class Processor
public boolean isSupportedRecordType(java.lang.String recordType)
isSupportedRecordType
in class Processor
recordType
- -- String text of record type to match (ignoring case).public java.util.ArrayList getProcClassNames()
The routine returns a list of:
super.getProcClassNames
procInstancePath.CFcompType
Use validProcessorClassName before adding class names to the list.
getProcClassNames
in class Processor
public java.util.ArrayList getCustomProcClassNames()
The routine returns a list of:
super.getCustomProcClassNames
customProcInstancePath.CFComponent
customProcInstancePath.custom.CFComponent
Use validProcessorClassName before adding class names to the list.
getCustomProcClassNames
in class Processor
protected java.lang.String getComponentProcClassName()
The routine returns a String of:
procInstancePath.CFComponent
protected boolean getWinAndCompGUIObjects() throws SAFSException
This routine is called only after all MixedUse recognition strings have separately been handled. This routine is called only after all non-GUI commands have separately been handled. This routine is only called if it has been determined we have a "normal" GUI command in which OBT window and component objects need to be found.
Found windowObjects will also have setActiveWindow invoked.
SAFSException
public void process()
At this point the Driver has determined we are dealing with a Test Record. A Test Record is one acting on a window or a component within a window.
Field #1: The TEST record type (T).
Subsequent fields would be as follows (with a separator between each field):
Field: #2 #3 #4 #5 - N
============== ============== ======== ===============
WINDOWNAME, COMPONENTNAME, ACTION, [PARAMETER(S),]
WINDOWNAME is the name given the window in the appmap that you intend to have focus for this test step.
COMPONENTNAME is the name of the component within that window you intend to perform some function or test on. If it is the window itself then the COMPONENTNAME should be the same as the WINDOWNAME.
ACTION is the command or test you wish to perform. Different types of components support different types of actions. Almost all support some versions of VERIFY actions. Pushbuttons can be CLICKed etc... Consult each Component's TYPE or CLASS documentation for the actions available for the component.
PARAMETER(s) are the additional fields needed based upon the action to be completed. Each action can have its own unique set of parameters. Some actions may take no parameters at all. Consult the component's TYPE or CLASS documentation for the parameters needed for a given action.
Although the separator used in the example above is a comma, any separator can be used as long as it is specified at the time the file is provided or in subsequent command lines which might change the separator in use. (Currently, changes are limited to a per file bases, but per line changes will be easy to implement when the need arises.)
The test record is processed out to functions according to the "Type" of the component in the record. Thus, components of Type=Window are sent to WindowFunctions and components of Type=Pushbutton are sent to PushbuttonFunctions. Currently, some Types of Generic, Other, and other oddities are processed out to Window or GenericObjectFunctions. This will allow some property verifications and maybe some image testcases but probably not too much else.
?? Some special handling occurs for certain Java components. In the event the compType, compModule, and compClass are ALL "Unknown"; we perform a check to see if "Java" appears anywhere in the recognition method provided by the user for the component. If it does, then we attempt to extract the component type out of the recognition method using the last "Type=" part of the string. If this is successful, we will then set the compType to that component type and set the compModule to "Java". This enables us to try and process Java components to the correct ComponentFunction even though Robot does not seem to properly recognize the type of component it is dealing with.
?? Popup menus are not of a real Component Type. The action commands for Popup menus are intercepted here and routed to the PopupMenuFunctions without doing the normal processing and verification of window and child objects. This is required due to the special nature of Popup menus and how they are handled by the operating system.
?? The same holds true for DatabaseFunctions. They are intercepted here and routed accordingly. (BETA)
NOTE:
A user or developer would not normally call this routine. This
routine is intended to be called from the StepDriver routine as
deemed necessary by the input records of the data table provided to
the StepDriver routine. The internals of this routine and the declaration
and parameters are all subject to change as necessary.
Side Effects: Processor.testRecordData
statusCode is set
based on the result of the processing
State Read: Processor.testRecordData
Assumptions: Various exceptions are caught here, and if so, the status
code is set to StatusCodes.SCRIPT_NOT_EXECUTED and a WARNING message is logged.
Added by dbauman Feb, 2004 so that a variable remains for the next test with
the status code. Copies the status code to variable 'customStatusCode'
protected int waitForObject(boolean isWindow) throws SAFSException
isWindow
- boolean. If true, waiting for window object; otherwise waiting for component object.SAFSException
#waitForObjectAndCheck(boolean)}
protected boolean waitForObjectAndCheck(boolean isWindow) throws SAFSException
isWindow
- boolean If true, the status is for window object; otherwise for component object.SAFSException
#waitForObject(boolean)}
protected boolean setActiveWindow() throws SAFSException
SAFSException
protected void postProcess()
added by dbauman Feb, 2004 so that a variable remains for the next test with the status code. copy the status code to variable 'customStatusCode'
protected java.util.Collection interpretFields() throws SAFSException
Processor.testRecordData
fields are set from the inputRecord.
Processor.testRecordData
, the inputRecord field
Field #1: The TEST record type (T).
Subsequent fields would be as follows (with a separator between each field):
Field: #2 #3 #4 #5 - N
============== ============== ======== ===============
WINDOWNAME, COMPONENTNAME, ACTION, [PARAMETER(S),]
SAFSException
protected boolean instantiateComponentFunction(java.util.Collection params) throws SAFSException
Processor.testRecordData
Finally, we make use of a HashMap of components already instantiated,
and reuse them if possible, so that we do not have to incurr the cost of
instantiating over and over again. field: '#functionMap
'
NOTE: a custom type can be defined by placing it into a package like: org.safs.rational.custom (that is tried second)
params,
- CollectionSAFSException
protected void componentFailureMessage(java.lang.String detail)
protected void componentWarningMessage(java.lang.String detail)
Copyright © SAS Institute. All Rights Reserved.