public class SeleniumJavaHook extends JavaHook
The STAF name predefined for this Selenium Engine is "SAFS/Selenium".
As of this writing, this hook uses standard org.safs.LogUtilities. The TestStepProcessor is the "standard" org.safs.TestStepProcessor.
The SAFS/Selenium engine does require Selenium-specific implementations of
If the engine is being launched manually or via a batch file or script then the following Java System property must be set on the Java command line:
testpath is the file path to the test configuration INI file,
projectpath is the file path to the project configuration INI file,
driverpath is the file path to the SAFS driver configuration INI file.
At least one INI file path must be specified or the engine will abort due to insufficient configuration information being provided.
The configuration file(s) must minimally provide the following information:
The configuration file(s) can optionally also contain:
(PROXY and PORT options previously supported have been deprecated in favor of the GATEWAYHOST and GATEWAYPORT options. However, PROXY and PORT still work.)
You can refer to the [SAFS_SELENIUM] setion in SAFSDRIVER Configuration. (See Settings for Selnium1.0)
Assuming everything is properly CLASSPATHed and the config file(s) have proper settings then the Engine can then be launched with:
java -Dsafs.config.paths=<paths> org.safs.selenium.SeleniumJavaHook
There is also the ability to launch the engine in a "Process Container" mode by adding a single command-line argument, "SPC" as in:
java -Dsafs.config.paths=<paths> org.safs.selenium.SeleniumJavaHook SPC
SeleniumGUIUtilities
,
STestRecordHelper
,
SPC
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_INT_SELENIUMPORT
4444
|
static java.lang.String |
DEFAULT_SELENIUMPORT
"4444"
|
static int |
DEFAULT_SELENIUMTIMEOUT
1000*60*5
|
static boolean |
RUNNING_SPC |
static java.lang.String |
SAFS_SELENIUM_SERVER_BOOTUP_READY |
static java.lang.String |
SAFS_USER_EXTENSIONS |
static java.lang.String |
SELENIUM_COMMANDS
Our predefined STAF process name: "SAFS/Selenium"
|
static java.io.File |
temp_user_extensions |
data, DEBUG_MESSAGE, errorText, FAILED_MESSAGE, FAILED_OK_MESSAGE, GENERIC_ERROR, GENERIC_MESSAGE, helper, hookconfig, log, PASSED_MESSAGE, PAUSE_EXECUTION, PAUSE_SWITCH_OFF, PAUSE_SWITCH_ON, process_name, processor, REQUEST_PROCEED_TESTING, REQUEST_USER_STOPPED_SCRIPT_REQUEST, RUNNING_EXECUTION, semaphore_name, SHUTDOWN_RECORD, STAF_ERROR, STEP_EXECUTION, STEP_RETRY_EXECUTION, STEPPING_EXECUTION, STEPPING_RETRY_EXECUTION, trd_name, utils, WARNING_MESSAGE, WARNING_OK_MESSAGE
Constructor and Description |
---|
SeleniumJavaHook()
No-arg constructor for SeleniumJavaHook
Simply calls the super()
|
SeleniumJavaHook(java.lang.String process_name)
Constructor for SeleniumJavaHook
Simply calls super(process_name)
|
SeleniumJavaHook(java.lang.String process_name,
LogUtilities logs)
Constructor for SeleniumJavaHook
Simply calls super(process_name, logs)
|
SeleniumJavaHook(java.lang.String process_name,
java.lang.String trd_name)
Constructor for SeleniumJavaHook
Simply calls super(process_name, trd_name)
|
SeleniumJavaHook(java.lang.String process_name,
java.lang.String trd_name,
LogUtilities logs)
Constructor for SeleniumJavaHook
Simply calls super(process_name, trd_name, logs)
|
SeleniumJavaHook(java.lang.String process_name,
java.lang.String trd_name,
LogUtilities logs,
TestRecordHelper trd_data,
DDGUIUtilities gui_utils,
ProcessRequest aprocessor)
Advanced Constructor for SeleniumJavaHook.
|
Modifier and Type | Method and Description |
---|---|
DDGUIUtilities |
getGUIUtilities()
Use this method to retrieve/create the current/default DDGUIUtilities instance.
|
LogUtilities |
getLogUtilities()
Use this method to retrieve/create the current/default LogUtilities instance.
|
ProcessRequest |
getRequestProcessor()
Use this method to retrieve/create the current/default ProcessRequest instance.
|
TestRecordHelper |
getTRDData()
Use this method to retrieve/create the current/default TestRecordHelper instance.
|
protected boolean |
hook_shutdown()
Perform final hook shutdown activities.
|
static void |
main(java.lang.String[] args)
Launches a default instance of the SAFS/Selenium engine.
|
void |
start()
Insert this SAFS Engine hook into the STAF system.
|
void |
stopJavaHOOK()
Used by SPC to imitate sending a SHUTDOWN_RECORD to JavaHook
who is waiting in getNextHookTestEvent() for a record-dispatched event. |
allowSystemExit, checkConfiguration, driverShutdownRequest, evaluateRuntimeException, getHelper, getProcessName, getSemaphoreName, getTRDName, initConfigPaths, instantiateHookConfig, setGUIUtilities, setHelper, setLogUtilities, setProcessName, setRequestProcessor, setSemaphoreName, setTRDData, setTRDName
public static final java.lang.String SELENIUM_COMMANDS
public static final java.lang.String SAFS_USER_EXTENSIONS
public static java.io.File temp_user_extensions
public static java.lang.String SAFS_SELENIUM_SERVER_BOOTUP_READY
public static final java.lang.String DEFAULT_SELENIUMPORT
public static final int DEFAULT_INT_SELENIUMPORT
public static final int DEFAULT_SELENIUMTIMEOUT
public static boolean RUNNING_SPC
public SeleniumJavaHook()
public SeleniumJavaHook(java.lang.String process_name)
process_name
- the ID to use when registering with STAF.
Normally this would be our predefined name "SAFS/Selenium".public SeleniumJavaHook(java.lang.String process_name, LogUtilities logs)
process_name
- the ID to use when registering with STAF.
Normally this would be our predefined name "SAFS/Selenium".logs
- the LogUtilities to be used by the Engine. Currently we can
use the default org.safs.LogUtilitiesorg.safs.LogUtilites
public SeleniumJavaHook(java.lang.String process_name, java.lang.String trd_name)
process_name
- the ID to use when registering with STAF.
Normally this would be our predefined name "SAFS/Selenium".trd_name
- -- The root name for specific TestRecordData to reference
in STAF. This should typically be STAFHelper.SAFS_HOOK_TRD which is used
by default.STAFHelper.SAFS_HOOK_TRD
public SeleniumJavaHook(java.lang.String process_name, java.lang.String trd_name, LogUtilities logs)
process_name
- the ID to use when registering with STAF.
Normally this would be our predefined name "SAFS/Selenium".trd_name
- -- The root name for specific TestRecordData to reference
in STAF. This should typically be STAFHelper.SAFS_HOOK_TRD which is used
by default.logs
- the LogUtilities to be used by the Engine. Currently we can
use the default org.safs.LogUtilitiesSTAFHelper.SAFS_HOOK_TRD
,
org.safs.LogUtilites
public SeleniumJavaHook(java.lang.String process_name, java.lang.String trd_name, LogUtilities logs, TestRecordHelper trd_data, DDGUIUtilities gui_utils, ProcessRequest aprocessor)
process_name
- the ID to use when registering with STAF.
Normally this would be our predefined name "SAFS/Selenium".trd_name
- -- The root name for specific TestRecordData to reference
in STAF. This should typically be STAFHelper.SAFS_HOOK_TRD which is used
by default.logs
- the LogUtilities to be used by the Engine. Currently we can
use the default org.safs.LogUtilitiestrd_data
- -- ATestRecordHelper to hold TestRecordData.
The Selenium engine expects an instance of ATestRecordHelper.gui_utils
- -- SeleniumGuiUtilities the hook will use for handling components.
The Selenium engine expects an instance of SeleniumGuiUtilities.aprocessor
- -- ProcessRequest object the hook will use for routing records.
The Selenium engine uses the standard ProcessRequest class and a standard TestStepProcessor.STAFHelper.SAFS_HOOK_TRD
,
org.safs.LogUtilites
,
STestRecordHelper
,
SeleniumGUIUtilities
,
ProcessRequest
,
TestStepProcessor
public TestRecordHelper getTRDData()
Note that there is a known circular execution between getTRDData and getGUIUtilities if neither was previously set. Each routine calls the other which may result in a second call to the other. This has not been a problem.
getTRDData
in class JavaHook
STestRecordHelper
,
JavaHook.getHelper()
,
getGUIUtilities()
,
JavaHook.getTRDData()
public DDGUIUtilities getGUIUtilities()
The SeleniumGUIUtilities talk with our embedded proxies over a SAFS RMI bridge. The local RMI server (AServerImpl) is instanced if not already set.
Note that there is a known circular execution between getTRDData and getGUIUtilities if neither was previously set. Each routine calls the other which may result in a second call to the other. This has not been a problem.
getGUIUtilities
in class JavaHook
JavaHook.getGUIUtilities()
,
JavaHook.getHelper()
,
getTRDData()
,
SeleniumGUIUtilities
,
SServerImpl
public LogUtilities getLogUtilities()
getLogUtilities
in class JavaHook
JavaHook.getLogUtilities()
,
org.safs.LogUtilities
public ProcessRequest getRequestProcessor()
getRequestProcessor
in class JavaHook
JavaHook.getRequestProcessor()
,
ProcessRequest
,
STestRecordHelper
,
getTRDData()
,
getLogUtilities()
,
org.safs.LogUtilities
,
TestStepProcessor
public void start()
JavaHook
public void stopJavaHOOK()
protected boolean hook_shutdown()
hook_shutdown
in class JavaHook
JavaHook.hook_shutdown()
,
JavaHook.allowSystemExit()
public static void main(java.lang.String[] args)
Assuming everything is properly CLASSPATHed, the default SAFS/Selenium Engine can be launched simply with:
Copyright © SAS Institute. All Rights Reserved.