public class DDriverCommand extends DriverCommand
Modifier and Type | Field and Description |
---|---|
protected java.util.Hashtable |
appids |
static java.lang.String |
CALLSCRIPT |
static java.lang.String |
CLOSEAPPLICATION |
protected java.lang.String |
command |
protected SAFSRemoteControl |
control |
protected DTestRecordHelper |
droiddata |
static java.lang.String |
LAUNCHAPPLICATION |
protected java.util.Properties |
props |
protected STAFHelper |
staf |
protected static java.lang.String |
TEMP_PROP_APP_ROTATABLE |
protected static java.lang.String |
TEMP_PROP_BLOCKID |
protected static java.lang.String |
TEMP_PROP_COMPNAME |
protected static java.lang.String |
TEMP_PROP_ENCODING |
protected static java.lang.String |
TEMP_PROP_FILENAME |
protected static java.lang.String |
TEMP_PROP_SUBAREA |
protected static java.lang.String |
TEMP_PROP_TIMEOUT |
protected static java.lang.String |
TEMP_PROP_VARIABLENAME |
protected static java.lang.String |
TEMP_PROP_WINDOWNAME |
protected java.util.Properties |
temp_props
used to pass values locally between process methods, and processResults
|
iterator, utils
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 |
---|
DDriverCommand() |
Modifier and Type | Method and Description |
---|---|
protected void |
doClipboardCommand()
Process clipboard related keywords:
AssignClipboardVariable ClearClipboard SaveClipboardToFile SetClipboard VerifyClipboardToFile |
protected void |
doClipboardResults(RemoteResults results)
Process result of clipboard related keywords:
AssignClipboardVariable ClearClipboard SaveClipboardToFile SetClipboard VerifyClipboardToFile |
protected void |
doCommandWithoutPrameter(int timeout)
This method is used to execute a keyword without parameter:
HideSoftKeyboard ShowSoftKeyboard |
protected void |
doCommandWithoutPrameterResults(RemoteResults results)
This method is used to handle result of a keyword without parameter:
HideSoftKeyboard ShowSoftKeyboard |
protected void |
doGUIBranching()
OnGuiExistsGotoBlockID and OnGuiNotExistGotoBlockID commands setup.
|
protected void |
doGuiBranchingResults(RemoteResults results)
OnGuiExistsGotoBlockID and OnGuiNotExistGotoBlockID commands remote results.
|
protected void |
doTakeScreenShotCommand()
This method is used to check the parameter of keyword TakeScreenShot.
Filename is the required parameter. Rotatable is the optional parameter. |
protected void |
doTakeScreenShotResults(RemoteResults results)
Process result of keyword TakeScreenShot.
The remote device side will return the rotate degree of the device. The ScreenShot will be got through API of the AndroidDebugBridger at computer side. The returned image is always that you put your device at the default direction. We should rotate that returned image back if the tested android application is rotatable. |
protected void |
doWaitForGui()
WaitForGui and WaitForGuiGone commands setup.
|
protected void |
doWaitForGuiResults(RemoteResults results)
WaitForGui and WaitForGuiGone commands remote results.
|
protected java.util.Collection |
interpretFields()
Calls the default processing of interpretFields and then prepares the
droiddata (testRecordData) with the initial KeywordProperties of:
|
protected void |
logResourceMessageFailure()
Log a FAILED_MESSAGE using whatever ResourceMessageInfo data is returned in
droiddata . |
void |
process()
The primary method that all subclasses must implement.
|
protected void |
processProperties(int param_timeout)
Sets Property PARAM_TIMEOUT and then processes the completed remote control action properties.
|
protected boolean |
processResourceMessageInfoResults(int msgType)
Logs any message or message with detail that might be captured in the current
droiddata . |
protected void |
processResults(RemoteResults results)
called internally by
processProperties(int) AFTER the remote execution has completed. |
void |
setTestRecordData(TestRecordHelper data) |
checkGUIExistence, commandProcess, getStandardFailureDetail, getStandardWarningDetail, init, issueActionUsingNegativeMessage, issueActionWarning, issueExecutionNegativeMessage, issueFileErrorFailure, issueGenericSuccess, issueGenericSuccess, issueGenericSuccessUsing, issueParameterCountFailure, issueParameterCountFailure, issueParameterValueFailure, issuePassedSuccess, issueUnknownErrorFailure, isSupportedRecordType, localProcess
activateBreakpoint, checkBreakpoints, checkMyBreakpoints, deduceBenchFile, deduceDiffFile, deduceProjectFile, deduceTestFile, delay, distributeConfigInformation, getAbsolutFileName, getAlternateParams, 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, setUnexpectedAlertBehaviour, setVariable, standardFailureMessage, substituteVariable, validateParamSize, validProcessorClassName
public static final java.lang.String CALLSCRIPT
public static final java.lang.String CLOSEAPPLICATION
public static final java.lang.String LAUNCHAPPLICATION
protected static final java.lang.String TEMP_PROP_BLOCKID
protected static final java.lang.String TEMP_PROP_WINDOWNAME
protected static final java.lang.String TEMP_PROP_COMPNAME
protected static final java.lang.String TEMP_PROP_TIMEOUT
protected static final java.lang.String TEMP_PROP_VARIABLENAME
protected static final java.lang.String TEMP_PROP_FILENAME
protected static final java.lang.String TEMP_PROP_ENCODING
protected static final java.lang.String TEMP_PROP_APP_ROTATABLE
protected static final java.lang.String TEMP_PROP_SUBAREA
protected java.lang.String command
protected java.util.Hashtable appids
protected DTestRecordHelper droiddata
protected java.util.Properties props
protected SAFSRemoteControl control
protected STAFHelper staf
protected java.util.Properties temp_props
public void setTestRecordData(TestRecordHelper data)
setTestRecordData
in class Processor
protected java.util.Collection interpretFields() throws SAFSException
Keyword implementations will need to add to these properties:
interpretFields
in class DriverCommand
SAFSException
public void process()
Processor
Thus, 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.
process
in class DriverCommand
protected void processProperties(int param_timeout) throws java.lang.IllegalThreadStateException, RemoteException, java.util.concurrent.TimeoutException, ShutdownInvocationException
droiddata
via DUtilities.captureRemoteResultsProperties(RemoteResults, DTestRecordHelper)
.
This routine then calls processResults(RemoteResults)
.java.util.concurrent.TimeoutException
- if the Ready, Running, or Results signals timeout.java.lang.IllegalThreadStateException
- if sockets communications failed.ShutdownInvocationException
- if sockets communication signals a shutdown has commenced.RemoteException
- if the remote client has issued an Exception.DUtilities.captureRemoteResultsProperties(RemoteResults, DTestRecordHelper)
protected void processResults(RemoteResults results)
processProperties(int)
AFTER the remote execution has completed.protected boolean processResourceMessageInfoResults(int msgType)
droiddata
.
The routine does not set or change any statusCode or statusInfo information.
If a message was found and logged, the routine returns TRUE. This means the caller does NOT have to log any success or failure message.
If no message was found, then the routine will return FALSE and the caller will need to log an appropriate message.
msgType
- -- int message type identifier constant as defined in
AbstractLogFacility
.protected void logResourceMessageFailure()
droiddata
.
The command does not change any statusCode or statusInfo information.
Calls processResourceMessageInfoResults(int)
to attempt the logging.
If there was no ResourceMessageInfo, we still log a generic failed message via Processor.issueActionFailure(String)
.protected void doGUIBranching() throws java.lang.IllegalThreadStateException, RemoteException, java.util.concurrent.TimeoutException, ShutdownInvocationException
Validates the presence of:
BLOCKID (PARAM_1)
WINDOWID (PARAM_2 and KEY_WINNAME)
COMPID (PARAM_3 and KEY_COMPNAME)
and the optional TIMEOUT parameter (PARAM_4 && PARAM_TIMEOUT)
Through DUtilities.getAppMapRecognition(DTestRecordHelper)
adds:
KEY_WINREC
KEY_COMPREC
The current implementation does expect recognition strings to exist in the App Map. If none are found, the command will issue a failure without making a remote call.
Upon successful execution of the command, the remote process should return:
java.lang.IllegalThreadStateException
RemoteException
java.util.concurrent.TimeoutException
ShutdownInvocationException
protected void doGuiBranchingResults(RemoteResults results)
Upon successful execution of the command, the remote process should return:
results
- -- returned from the processProperties call.protected void doWaitForGui() throws java.lang.IllegalThreadStateException, RemoteException, java.util.concurrent.TimeoutException, ShutdownInvocationException
Validates the presence of:
WINDOWID (PARAM_1 && KEY_WINNAME)
COMPID (PARAM_2 && KEY_COMPNAME)
and the optional TIMEOUT parameter (PARAM_3 && PARAM_TIMEOUT)
Through DUtilities.getAppMapRecognition(DTestRecordHelper)
adds:
KEY_WINREC
KEY_COMPREC
The current implementation does expect recognition strings to exist in the App Map. If none are found, the command will issue a failure without making a remote call.
Upon successful execution of the command, the remote process should return:
java.lang.IllegalThreadStateException
RemoteException
java.util.concurrent.TimeoutException
ShutdownInvocationException
protected void doWaitForGuiResults(RemoteResults results)
Upon successful execution of the command, the remote process should return:
results
- -- returned from the processProperties call.protected void doClipboardCommand() throws java.lang.IllegalThreadStateException, RemoteException, java.util.concurrent.TimeoutException, ShutdownInvocationException
Validates the presence of:
FileName (PARAM_1) for keyword SaveClipboardToFile and VerifyClipboardToFile
ContentToSet (PARAM_1) for keyword SetClipboard
VariableName (PARAM_1) for keyword AssignClipboardVariable
Then pass the command to the remote side to be processed.
Upon successful execution of the command, the remote process should return:
java.lang.IllegalThreadStateException
RemoteException
java.util.concurrent.TimeoutException
ShutdownInvocationException
protected void doTakeScreenShotCommand() throws java.lang.IllegalThreadStateException, RemoteException, java.util.concurrent.TimeoutException, ShutdownInvocationException
java.lang.IllegalThreadStateException
RemoteException
java.util.concurrent.TimeoutException
ShutdownInvocationException
protected void doTakeScreenShotResults(RemoteResults results)
results
- RemoteResults, returned from the processProperties call.protected void doClipboardResults(RemoteResults results)
Upon successful execution of the command, the remote process should return:
results
- -- returned from the processProperties call.protected void doCommandWithoutPrameter(int timeout) throws java.lang.IllegalThreadStateException, RemoteException, java.util.concurrent.TimeoutException, ShutdownInvocationException
java.lang.IllegalThreadStateException
RemoteException
java.util.concurrent.TimeoutException
ShutdownInvocationException
protected void doCommandWithoutPrameterResults(RemoteResults results)
results
- RemoteResults, returned from the processProperties call.Copyright © SAS Institute. All Rights Reserved.