Package jp.vmi.selenium.selenese
Interface Context
-
- All Superinterfaces:
SubCommandMapProvider,org.openqa.selenium.WrapsDriver
- All Known Implementing Classes:
NullContext,Runner
public interface Context extends org.openqa.selenium.WrapsDriver, SubCommandMapProvider
Selenese Runner Context.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> TexecuteAsyncScript(String script, Object... args)Executes JavaScript in the context of the currently selected frame or window.default <T> TexecuteScript(String script, Object... args)Executes JavaScript in the context of the currently selected frame or window.default org.openqa.selenium.WebElementfindElement(String locator)Find an elementdefault List<org.openqa.selenium.WebElement>findElements(String locator)Find elementsdefault StringgetBrowserName()Get browser name.CollectionMapgetCollectionMap()Get collection map.ICommandFactorygetCommandFactory()Get CommandFactory instance.CommandListIteratorgetCommandListIterator()Get current CommandListIterator.CookieFiltergetCookieFilter()Get cookie filter.StringgetCurrentBaseURL()Get current base URL.TestCasegetCurrentTestCase()Get current test-case.WebDriverElementFindergetElementFinder()Get elemnt finder.EvalgetEval()Get evaluater.default <T extends FlowControlState>
TgetFlowControlState(ICommand command)Get flow control state.StringgetInitialWindowHandle()Get initial window handle.JSLibrarygetJSLibrary()Get JavaScript library handler.PageInformationgetLatestPageInformation()Get latest page information.EnumSet<LogFilter>getLogFilter()Get list of disabled page information.default intgetMaxRetries()Get maximum number of retries allowed for a given test.ModifierKeyStategetModifierKeyState()Get modifier key state.AlertActionListenergetNextNativeAlertActionListener()Get next native alert action.StringgetOverridingBaseURL()Get base URL for overriding test-case base URL.PrintStreamgetPrintStream()Get PrintStream for logging.default intgetRetries()Get number of actually used retries.RollupRulesgetRollupRules()Get rollup rules.longgetSpeed()Get speed for setSpeed command.default TestCaseMapgetTestCaseMap()Get test-case map.intgetTimeout()Get timeout for waiting.VarsMapgetVarsMap()Get variables map.default booleanhasReachedMaxRetries()True if number of actually used retries has reached maximum number of retries.default voidincrementRetries()Increment number of actually used retries.default booleanisBrowser(String name)Test browser name.booleanisInteractive()Get interactive.booleanisTrue(String expr)Get boolean value of expr.default booleanisW3cAction()Is Action command W3C compatible?voidpopCommandListIterator()Pop CommandListIterator.voidprepareWebDriver()Prepare WebDriver.voidpushCommandListIterator(CommandListIterator commandListIterator)Push CommandListIterator.default voidresetRetries()Reset number of actually used retries.voidresetSpeed()Reset speed as initial speed.voidresetState()Reset internal state.voidsetCookieFilter(CookieFilter cookieFilter)Set cookie filter.voidsetCurrentTestCase(TestCase testCase)Set current test-case.default <T extends FlowControlState>
voidsetFlowControlState(ICommand command, T state)Set flow control state.voidsetJSLibrary(JSLibrary jsLibrary)Set JavaScript library handler.voidsetLatestPageInformation(PageInformation pageInformation)Set latest page information.default voidsetMaxRetries(int maxRetries)Set the maximum number of retries allowed for a given test.voidsetSpeed(long speed)Set speed for setSpeed command.default voidsetTestCaseMap(TestCaseMap testCaseMap)Set test-case map.voidsetTimeout(int timeout)Set timeout for waiting.voidwaitSpeed()Wait according to speed setting.-
Methods inherited from interface jp.vmi.selenium.selenese.SubCommandMapProvider
getSubCommandMap
-
-
-
-
Method Detail
-
prepareWebDriver
void prepareWebDriver()
Prepare WebDriver.
-
getBrowserName
default String getBrowserName()
Get browser name.- Returns:
- browser name.
-
isBrowser
default boolean isBrowser(String name)
Test browser name.- Parameters:
name- browser name.- Returns:
- true if match browser name.
-
getCurrentTestCase
TestCase getCurrentTestCase()
Get current test-case.- Returns:
- current test-case.
-
setCurrentTestCase
void setCurrentTestCase(TestCase testCase)
Set current test-case.- Parameters:
testCase- current test-case.
-
getPrintStream
PrintStream getPrintStream()
Get PrintStream for logging.- Returns:
- PrintStram object.
-
getOverridingBaseURL
String getOverridingBaseURL()
Get base URL for overriding test-case base URL.- Returns:
- base URL.
-
getCurrentBaseURL
String getCurrentBaseURL()
Get current base URL.- Returns:
- base URL.
-
getCommandFactory
ICommandFactory getCommandFactory()
Get CommandFactory instance.- Returns:
- CommandFactory instance.
-
getCommandListIterator
CommandListIterator getCommandListIterator()
Get current CommandListIterator.- Returns:
- current CommanListIterator.
-
pushCommandListIterator
void pushCommandListIterator(CommandListIterator commandListIterator)
Push CommandListIterator.- Parameters:
commandListIterator- CommanListIterator.
-
popCommandListIterator
void popCommandListIterator()
Pop CommandListIterator.
-
getVarsMap
VarsMap getVarsMap()
Get variables map.- Returns:
- VarsMap.
-
getTestCaseMap
default TestCaseMap getTestCaseMap()
Get test-case map.- Returns:
- test-case map.
-
setTestCaseMap
default void setTestCaseMap(TestCaseMap testCaseMap)
Set test-case map.- Parameters:
testCaseMap- test-case map.
-
getFlowControlState
default <T extends FlowControlState> T getFlowControlState(ICommand command)
Get flow control state.- Type Parameters:
T- the class implements FlowControlState.- Parameters:
command- flow control command.- Returns:
- flow control state.
-
setFlowControlState
default <T extends FlowControlState> void setFlowControlState(ICommand command, T state)
Set flow control state.- Type Parameters:
T- the class implements FlowControlState.- Parameters:
command- flow control command.state- flow control state.
-
getRollupRules
RollupRules getRollupRules()
Get rollup rules.- Returns:
- RollupRules object.
-
getCollectionMap
CollectionMap getCollectionMap()
Get collection map.- Returns:
- CollectionMap.
-
getInitialWindowHandle
String getInitialWindowHandle()
Get initial window handle.- Returns:
- window handle.
-
getElementFinder
WebDriverElementFinder getElementFinder()
Get elemnt finder.- Returns:
- element finder.
-
findElements
default List<org.openqa.selenium.WebElement> findElements(String locator)
Find elements- Parameters:
locator- locator.- Returns:
- list of found elements. (empty if no element)
-
findElement
default org.openqa.selenium.WebElement findElement(String locator)
Find an element- Parameters:
locator- locator.- Returns:
- found element.
- Throws:
org.openqa.selenium.NoSuchElementException- throw if element not found.
-
getEval
Eval getEval()
Get evaluater.- Returns:
- eval object.
-
isTrue
boolean isTrue(String expr)
Get boolean value of expr.- Parameters:
expr- expression.- Returns:
- cast from result of expr to Javascript Boolean.
-
getTimeout
int getTimeout()
Get timeout for waiting. (ms)- Returns:
- timeout for waiting.
-
setTimeout
void setTimeout(int timeout)
Set timeout for waiting. (ms)- Parameters:
timeout- for waiting.
-
resetSpeed
void resetSpeed()
Reset speed as initial speed.
-
getSpeed
long getSpeed()
Get speed for setSpeed command.- Returns:
- speed.
-
setSpeed
void setSpeed(long speed)
Set speed for setSpeed command.- Parameters:
speed- speed.
-
waitSpeed
void waitSpeed()
Wait according to speed setting.
-
getLatestPageInformation
PageInformation getLatestPageInformation()
Get latest page information.- Returns:
- page information.
-
setLatestPageInformation
void setLatestPageInformation(PageInformation pageInformation)
Set latest page information.- Parameters:
pageInformation- page information.
-
getLogFilter
EnumSet<LogFilter> getLogFilter()
Get list of disabled page information.- Returns:
- list of disabled page information.
-
getCookieFilter
CookieFilter getCookieFilter()
Get cookie filter.- Returns:
- cookie filter.
-
setCookieFilter
void setCookieFilter(CookieFilter cookieFilter)
Set cookie filter.- Parameters:
cookieFilter- cookie filter.
-
getJSLibrary
JSLibrary getJSLibrary()
Get JavaScript library handler.- Returns:
- JavaScript library handler.
-
setJSLibrary
void setJSLibrary(JSLibrary jsLibrary)
Set JavaScript library handler.- Parameters:
jsLibrary- JavaScript library handler.
-
getModifierKeyState
ModifierKeyState getModifierKeyState()
Get modifier key state.- Returns:
- modifier key state.
-
resetState
void resetState()
Reset internal state.
-
isInteractive
boolean isInteractive()
Get interactive.- Returns:
- interactive.
-
getNextNativeAlertActionListener
AlertActionListener getNextNativeAlertActionListener()
Get next native alert action.- Returns:
- next native alert state
-
isW3cAction
default boolean isW3cAction()
Is Action command W3C compatible?- Returns:
- true if Action command is W3C compatible.
-
executeScript
default <T> T executeScript(String script, Object... args)
Executes JavaScript in the context of the currently selected frame or window. seeJavascriptExecutor.executeScript(String, Object...).- Type Parameters:
T- type of return value.- Parameters:
script- The JavaScript to executeargs- The arguments to the script. May be empty- Returns:
- One of Boolean, Long, String, List or WebElement. Or null.
-
executeAsyncScript
default <T> T executeAsyncScript(String script, Object... args)
Executes JavaScript in the context of the currently selected frame or window. seeJavascriptExecutor.executeAsyncScript(String, Object...).- Type Parameters:
T- type of return value.- Parameters:
script- The JavaScript to executeargs- The arguments to the script. May be empty- Returns:
- One of Boolean, Long, String, List or WebElement. Or null.
-
resetRetries
default void resetRetries()
Reset number of actually used retries.
-
incrementRetries
default void incrementRetries()
Increment number of actually used retries.
-
hasReachedMaxRetries
default boolean hasReachedMaxRetries()
True if number of actually used retries has reached maximum number of retries.- Returns:
- true if retries has reached max retries.
-
getRetries
default int getRetries()
Get number of actually used retries.- Returns:
- number of actually used retries.
-
getMaxRetries
default int getMaxRetries()
Get maximum number of retries allowed for a given test.- Returns:
- the maximum number of retries allowed for a given test.
-
setMaxRetries
default void setMaxRetries(int maxRetries)
Set the maximum number of retries allowed for a given test.- Parameters:
maxRetries- the maximum number of retries allowed for a given test.
-
-