public class Utils
extends java.lang.Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
defineStoredVars(com.sebuilder.interpreter.TestRun ctx) |
static java.lang.Object |
executeScript(com.sebuilder.interpreter.TestRun ctx,
java.lang.String script)
Prepend 'script' with the associate-array
Constants.PARAM_STOREDVARS_ARRAY
holding variables in the variable store of context (TestRun), and then execute them together. |
static java.lang.Object |
executeScript(com.sebuilder.interpreter.TestRun ctx,
java.lang.String script,
boolean sync)
Prepend 'script' with the associate-array
Constants.PARAM_STOREDVARS_ARRAY
holding variables in the variable store of context (TestRun), and then execute them together. |
static boolean |
isNegativeCommand(java.lang.String command)
Some command (such as 'assert', 'verify' and 'waitFor') can be
appended with a getter (such as 'Text', 'Location' etc.) to form
a positive command (assertText, verifyLocation); they can also be
appended 'Not' before the getter to form a negative command
(assertNotText, verifyNotLocation).
This method will tell us if the command is a negative command. |
static java.lang.String |
normalize(java.lang.String jscode)
The testing tool (such as Selenium IDE) generated-javascript may
be embedded between
Constants.PARAM_SCRIPT_PREFIX and Constants.PARAM_SCRIPT_SUFFIX . |
static void |
setParam(com.sebuilder.interpreter.Step step,
com.sebuilder.interpreter.Getter getter,
java.lang.String parameter)
According the step type, set the parameter into the step's variable store.
|
public static java.lang.String normalize(java.lang.String jscode)
Constants.PARAM_SCRIPT_PREFIX
and Constants.PARAM_SCRIPT_SUFFIX
.
We need to remove them to get the real javascript code to execute.jscode
- String, the javascript code.public static java.lang.String defineStoredVars(com.sebuilder.interpreter.TestRun ctx)
ctx
- TestRun, the context object.Constants.PARAM_STOREDVARS_ARRAY
holding
variables in the variable store of context (TestRun).public static java.lang.Object executeScript(com.sebuilder.interpreter.TestRun ctx, java.lang.String script)
Constants.PARAM_STOREDVARS_ARRAY
holding variables in the variable store of context (TestRun), and then execute them together.ctx
- TestRun, the context within which to execute the scriptscript
- String, the script to execute, it should be normalized.defineStoredVars(TestRun)
public static java.lang.Object executeScript(com.sebuilder.interpreter.TestRun ctx, java.lang.String script, boolean sync)
Constants.PARAM_STOREDVARS_ARRAY
holding variables in the variable store of context (TestRun), and then execute them together.ctx
- TestRun, the context within which to execute the scriptscript
- String, the script to execute, it should be normalized.sync
- boolean, if the script should be executed synchronously.
If false, this method will return immediately.defineStoredVars(TestRun)
public static void setParam(com.sebuilder.interpreter.Step step, com.sebuilder.interpreter.Getter getter, java.lang.String parameter)
step
- Step, for which to set the parametergetter
- Getter, from which to get the parameter's nameparameter
- String, the parameter to store. public static boolean isNegativeCommand(java.lang.String command)
command
- String, the name of commandCopyright © SAS Institute. All Rights Reserved.