public class SAFSDROID extends GenericEngine
This is intended for testing of Android Smartphone and Tablet applications.
The default SAFSDRIVER Tool-Independent Driver (TID) does not provide for any command-line options to configure the Engine. All configuration information must be provided in config files. By default, these are SAFSTID.INI files. See SAFSTID Config Files for more information.
The Droid supported config file items are listed below. Remember, this engine has only been tested on Windows, so all sample file paths are in Windows format:
[SAFS_DROID] AUTOLAUNCH=FALSE (Defaults to FALSE because config info must be valid.) DroidProject=C:\SAFS\samples\Droid (Sample Droid Automation Project Location) Console2Debug=True/False (Allow the process console (adb) into the driver console/debug log.) ;ShutdownDelay=N (default: 0, Delay in seconds to delay the shutdown to allow remote process completion.) ;HOOK=org.safs.android.DJavaHook (Java SAFS Engine Class) ;EMULATOR_AVD="SprintEVO" (User-Defined Emulator AVD to use, if any) ;ANDROID-SDK=Android SDK Root Dir (Root dir for Android SDK) ;ANDROID-TOOLS=Android SDK Tools Dir ([Sub]Dir for Android SDK Tools) ;TCPMessengerAPK=path to Messenger (default: SAFSTCPMessenger\bin\SAFSTCPMessenger-debug.apk) ;TCPMessengerPackage=packageName (default: org.safs.android.messenger ) ;TestRunnerAPK=path to Engine APK (default: SAFSTestRunner\bin\SAFSTestRunner-debug.apk) ;TestRunnerPackage=packageName (default: org.safs.android.engine ) ;TestRunnerSource=path to source (Ex: "SAFSTestRunner" (Project relative or absolute) ;DeviceSerial=serial number (a specific adb -s device/emulator if multiple are present) ;PersistEmulators=True/False (default: false. True to NOT force shutdown of emulators) ;PersistJVM=True/False (default: false. True to try to stop the shutdown of JVM.) ;TIMEOUT=120 (Alternate AutoLaunch timeout value in seconds) ;STAFID="SAFS/DROID" (Normally never used.) ;JVM=JVMpath (Full path to desired Java executable if "java" is not sufficient.) ;JVMARGS=JVM Args (Ex: "-Xms512m -Xmx512m", will be used unmodified.) ;CLASSPATH=altClasspath (Generally overrides system classpath.) ;XBOOTCLASSPATH=<CLASSPATH> (CLASSPATH needed for rare cases. Normally never used.) ;ConvertSAFSInputKeysSyntax=ON|OFF ([FUTURE]ON to use SAFS InputKeys syntax on Android)
We do use a ProcessConsole to keep the Process in, out, and err streams from filling up.
Runtime.exec
Runtime.exec Process
@author Carl Nagle DEC 15, 2011 Original Release
ProcessCapture
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AUTOLAUNCH_OPTION |
static java.lang.String |
DEBUG2CONSOLE_OPTION |
static int |
DEFAULT_INIT_TIMEOUT |
static java.lang.String |
EMULATOR_AVD_OPTION |
static java.lang.String |
ENGINE_NAME
"SAFS/DROID" -- The name of this engine as registered with STAF.
|
static java.lang.String |
HOOK_CLASS
"org.safs.ios.JavaHook"
|
static java.lang.String |
HOOK_OPTION |
static java.lang.String |
JVM_OPTION |
static java.lang.String |
JVMARGS_OPTION |
static java.lang.String |
PROJECT_OPTION |
static java.lang.String |
SHUTDOWN_DELAY_OPTION |
(package private) int |
shutdown_delay_seconds
Default 0.
|
static java.lang.String |
TIMEOUT_OPTION |
static java.lang.String |
XBOOTCLASSPATH_OPTION |
console, process, testRecordData, testrecordStackable
config, customStr, customText, debugStr, debugText, driver, DRIVER_TEMP_PROCESS, failedStr, failedText, genericStr, genericText, launchCount, log, machine, otherStr, otherText, passedStr, passedText, processName, running, SAFS_RESBUN_NAME, servicename, shutdownCount, staf, STAFPROC_EXE, warningStr, warningText, weStartedService, weStartedSTAF
COMMAND_SHUTDOWN_HOOK
Constructor and Description |
---|
SAFSDROID()
Constructor for SAFS/DROID.
|
SAFSDROID(DriverInterface driver)
PREFERRED Constructor for SAFS/DROID.
|
Modifier and Type | Method and Description |
---|---|
void |
launchInterface(java.lang.Object configInfo)
Extracts configuration information and launches SAFS/DROID initialization in a new process.
|
protected void |
postShutdownServiceDelay()
Allow any emulator shutdown activities to complete before JVM terminates.
|
long |
processRecord(TestRecordHelper testRecordData)
Override superclass to catch unsuccessful initialization scenarios.
|
deduceBenchFile, deduceProjectFile, deduceTestFile, getAppMapItem, getEngineName, getVariable, isToolRunning, logMessage, makeQuotedPath, makeQuotedString, popTestRecord, pushTestRecord, reset, resetShutdownSemaphore, saveTestRecordScreenToTestDirectory, setTRDStatus, setVariable, shutdownService, waitHookShutdownAndReset
configureJSTAFServiceEmbeddedJVMOption, extendedGenericMessage, finalize, getCoreInterface, getEmbeddedJVMBinPath, getSTAFHelper, logMessage, setLogUtilities, setLogUtilities, shutdown, simpleGenericMessage, simpleGenericSuccessMessage, simpleGenericWarningMessage, simpleSuccessMessage, simpleSuccessMessage, simpleSuccessUsingMessage, standardErrorMessage, waitForServiceStartCompletion
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCoreInterface, shutdown
public static final java.lang.String ENGINE_NAME
public static final java.lang.String HOOK_CLASS
public static final java.lang.String AUTOLAUNCH_OPTION
public static final java.lang.String HOOK_OPTION
public static final java.lang.String DEBUG2CONSOLE_OPTION
public static final java.lang.String SHUTDOWN_DELAY_OPTION
public static final java.lang.String PROJECT_OPTION
public static final java.lang.String EMULATOR_AVD_OPTION
public static final java.lang.String JVM_OPTION
public static final java.lang.String JVMARGS_OPTION
public static final java.lang.String XBOOTCLASSPATH_OPTION
public static final java.lang.String TIMEOUT_OPTION
public static final int DEFAULT_INIT_TIMEOUT
int shutdown_delay_seconds
public SAFSDROID()
public SAFSDROID(DriverInterface driver)
public void launchInterface(java.lang.Object configInfo)
launchInterface
in interface ConfigurableToolsInterface
launchInterface
in class GenericEngine
configInfo
- can be whatever the final implementation needs it to be. This
might be a String with configuration information, the name of a class, or an instance
of some object used to provide configuration assets.GenericEngine.launchInterface(Object)
protected void postShutdownServiceDelay()
shutdown_delay_seconds
seconds.postShutdownServiceDelay
in class GenericEngine
public long processRecord(TestRecordHelper testRecordData)
processRecord
in interface EngineInterface
processRecord
in class GenericEngine
EngineInterface#processRecord()
Copyright © SAS Institute. All Rights Reserved.