Package org.mozilla.zest.core.v1
Interface ZestRuntime
-
- All Superinterfaces:
ZestOutputWriter
- All Known Implementing Classes:
ZestBasicRunner
public interface ZestRuntime extends ZestOutputWriter
The Interface ZestRuntime.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaddWebDriver(String handle, org.openqa.selenium.WebDriver wd)Add a handle associated with a WebDriverdefault StringgetGlobalVariable(String name)Gets a global variable.ZestRequestgetLastRequest()Get the last request.ZestResponsegetLastResponse()Get the last response.StringgetProxy()Gets the proxy, as host:portScriptEngineFactorygetScriptEngineFactory()StringgetVariable(String name)Get the current value of the specified variable.org.openqa.selenium.WebDrivergetWebDriver(String handle)Get the WebDriver assicated with the handleList<org.openqa.selenium.WebDriver>getWebDrivers()Return all of the WebDriversvoidremoveWebDriver(String handle)Remove a handle associated with a WebDriverStringreplaceVariablesInString(String str, boolean urlEncode)Replace any variables in the supplied stringdefault voidsetGlobalVariable(String name, String value)Sets or removes a global variable.voidsetProxy(String host, int port)Sets the proxy.voidsetStandardVariables(ZestRequest request)Sets the standard variables for a request.voidsetStandardVariables(ZestResponse response)Sets the standard variables for a response.voidsetVariable(String name, String value)Set the value of the specified variable.-
Methods inherited from interface org.mozilla.zest.core.v1.ZestOutputWriter
debug, output
-
-
-
-
Method Detail
-
getVariable
String getVariable(String name)
Get the current value of the specified variable.- Parameters:
name- the name- Returns:
- the current value of the specified variable
-
setVariable
void setVariable(String name, String value)
Set the value of the specified variable.- Parameters:
name-value-
-
getGlobalVariable
default String getGlobalVariable(String name)
Gets a global variable.The global variables should outlive and be available to all scripts. How and where the variables are persisted and for how long is left as an implementation detail.
- Parameters:
name- the name of the variable.- Returns:
- the value of the variable, might be
nullif no value was previously set. - Since:
- 0.14.0
- See Also:
setGlobalVariable(String, String)
-
setGlobalVariable
default void setGlobalVariable(String name, String value)
Sets or removes a global variable.The variable is removed when the
valueisnull.- Parameters:
name- the name of the variable.value- the value of the variable.- Since:
- 0.14.0
- See Also:
getGlobalVariable(String)
-
getLastResponse
ZestResponse getLastResponse()
Get the last response.- Returns:
- the last response
-
getLastRequest
ZestRequest getLastRequest()
Get the last request.- Returns:
- the last request
-
replaceVariablesInString
String replaceVariablesInString(String str, boolean urlEncode)
Replace any variables in the supplied string- Parameters:
str-urlEncode-- Returns:
- the string with the variables replaces
-
getScriptEngineFactory
ScriptEngineFactory getScriptEngineFactory()
-
setStandardVariables
void setStandardVariables(ZestRequest request)
Sets the standard variables for a request.- Parameters:
request- the new standard variables
-
setStandardVariables
void setStandardVariables(ZestResponse response)
Sets the standard variables for a response.- Parameters:
response- the new standard variables
-
setProxy
void setProxy(String host, int port)
Sets the proxy.- Parameters:
host- the hostport- the port
-
getProxy
String getProxy()
Gets the proxy, as host:port
-
addWebDriver
void addWebDriver(String handle, org.openqa.selenium.WebDriver wd)
Add a handle associated with a WebDriver- Parameters:
handle-wd-
-
removeWebDriver
void removeWebDriver(String handle)
Remove a handle associated with a WebDriver- Parameters:
handle-
-
getWebDriver
org.openqa.selenium.WebDriver getWebDriver(String handle)
Get the WebDriver assicated with the handle- Parameters:
handle-- Returns:
- the
WebDriver.
-
getWebDrivers
List<org.openqa.selenium.WebDriver> getWebDrivers()
Return all of the WebDrivers- Returns:
- all the
WebDrivers.
-
-