public class Runner extends Object implements Context, ScreenshotHandler, HighlightHandler, JUnitResultHolder, HtmlResultHolder
| Modifier and Type | Class and Description |
|---|---|
static class |
Runner.MaxTimeTimer
Interrupt main thread after the seconds specified by
--max-time option. |
| Constructor and Description |
|---|
Runner()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Result |
execute(Selenese selenese)
Execute test-suite / test-case.
|
void |
finish()
Finish test.
|
String |
getBrowserName()
Get browser name.
|
CollectionMap |
getCollectionMap()
Get collection map.
|
CommandFactory |
getCommandFactory()
Get CommandFactory instance.
|
CommandListIterator |
getCommandListIterator()
Get current CommandListIterator.
|
CookieFilter |
getCookieFilter()
Get cookie filter.
|
String |
getCurrentBaseURL()
Get current base URL.
|
TestCase |
getCurrentTestCase()
Get current test-case.
|
WebDriverElementFinder |
getElementFinder()
Get elemnt finder.
|
Eval |
getEval()
Get evaluater.
|
HtmlResult |
getHtmlResult()
Get HTML result instance.
|
long |
getInitialSpeed()
Get initial speed at starting test-suite.
|
String |
getInitialWindowHandle()
Get initial window handle.
|
JSLibrary |
getJSLibrary()
Get JavaScript library handler.
|
JUnitResult |
getJUnitResult()
Get JUnit result instance.
|
PageInformation |
getLatestPageInformation()
Get latest page information.
|
ModifierKeyState |
getModifierKeyState()
Get modifier key state.
|
String |
getOverridingBaseURL()
Get base URL for overriding test-case base URL.
|
PrintStream |
getPrintStream()
Get PrintStream for logging.
|
RollupRules |
getRollupRules()
Get rollup rules.
|
long |
getSpeed()
Get speed for setSpeed command.
|
SubCommandMap |
getSubCommandMap()
Get SubCommandMap instance.
|
int |
getTimeout()
Get timeout for waiting.
|
VarsMap |
getVarsMap()
Get variables map.
|
org.openqa.selenium.WebDriver |
getWrappedDriver() |
void |
highlight(Locator ploc,
HighlightStyle highlightStyle)
Highlight and backup specified locator.
|
boolean |
isHighlight()
Get locator highlighting.
|
boolean |
isIgnoredScreenshotCommand()
Get ignore screenshot command flag.
|
boolean |
isInteractive()
Get interactive.
|
boolean |
isTrue(String expr)
Get boolean value of expr.
|
void |
popCommandListIterator()
Pop CommandListIterator.
|
void |
prepareWebDriver()
Prepare WebDriver.
|
void |
pushCommandListIterator(CommandListIterator commandListIterator)
Push CommandListIterator.
|
void |
resetSpeed()
Reset speed as initial speed.
|
void |
resetState()
Reset internal state.
|
Result |
run(String... filenames)
Run Selenese script files.
|
Result |
run(String filename,
InputStream is)
Run Selenese script from input stream.
|
void |
setCommandLineArgs(String[] args)
Set command line arguments.
|
void |
setCookieFilter(CookieFilter cookieFilter)
Set cookie filter.
|
void |
setCurrentTestCase(TestCase currentTestCase)
Set current test-case.
|
void |
setDriver(org.openqa.selenium.WebDriver driver)
Set WebDriver.
|
void |
setHighlight(boolean isHighlight)
Set locator highlighting.
|
void |
setHtmlResultDir(String dir)
Initialize HTMLResult.
|
void |
setIgnoredScreenshotCommand(boolean isIgnoredScreenshotCommand)
Set ignore screenshot command flag.
|
void |
setInitialSpeed(long initialSpeed)
Set initial speed at starting test-suite.
|
void |
setInteractive(boolean isInteractive)
Set interactive.
|
void |
setJSLibrary(JSLibrary jsLibrary)
Set JavaScript library handler.
|
void |
setJUnitResultDir(String dir)
Initialize JUnitResult.
|
void |
setLatestPageInformation(PageInformation pageInformation)
Set latest page information.
|
void |
setOverridingBaseURL(String overridingBaseURL)
Set URL for overriding test-case base URL.
|
void |
setPrintStream(PrintStream ps)
Set PrintStream for logging.
|
void |
setScreenshotAllDir(String screenshotAllDir)
Set directory for storing screenshots at all commands.
|
void |
setScreenshotDir(String screenshotDir)
Set directory for storing screenshots.
|
void |
setScreenshotOnFailDir(String screenshotOnFailDir)
Set directory for storing screenshot on fail.
|
void |
setSpeed(long speed)
Set speed for setSpeed command.
|
void |
setTimeout(int timeout)
Set timeout for waiting.
|
void |
setVarsMap(VarsMap varsMap)
Set variables map used for this session.
|
void |
setWebDriverPreparator(WebDriverPreparator preparator)
Set WebDriverPreparator.
|
String |
takeScreenshot(String filename)
Take screenshot to filename.
|
String |
takeScreenshotAll(String prefix,
int index)
Take screenshot at all commands if --screenshot-all option specified.
|
String |
takeScreenshotOnFail(String prefix,
int index)
Take screenshot on fail commands if --screenshot-on-fail option specified.
|
void |
unhighlight()
Unhighlight backed up styles.
|
void |
waitSpeed()
Wait according to speed setting.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecuteScript, findElement, findElements, isBrowserpublic void setCommandLineArgs(String[] args)
args - command line arguments.public TestCase getCurrentTestCase()
ContextgetCurrentTestCase in interface Contextpublic void setCurrentTestCase(TestCase currentTestCase)
ContextsetCurrentTestCase in interface ContextcurrentTestCase - current test-case.public void setPrintStream(PrintStream ps)
ps - PrintStream for logging.public PrintStream getPrintStream()
ContextgetPrintStream in interface Contextpublic String takeScreenshot(String filename) throws org.openqa.selenium.WebDriverException, UnsupportedOperationException
ScreenshotHandlertakeScreenshot in interface ScreenshotHandlerfilename - filename.UnsupportedOperationException - WebDriver does not supoort capturing screenshot.org.openqa.selenium.WebDriverExceptionpublic String takeScreenshotAll(String prefix, int index)
ScreenshotHandlertakeScreenshotAll in interface ScreenshotHandlerprefix - prefix name.index - command index.public String takeScreenshotOnFail(String prefix, int index)
ScreenshotHandlertakeScreenshotOnFail in interface ScreenshotHandlerprefix - prefix name.index - command index.public org.openqa.selenium.WebDriver getWrappedDriver()
getWrappedDriver in interface org.openqa.selenium.internal.WrapsDriverpublic String getInitialWindowHandle()
ContextgetInitialWindowHandle in interface Contextpublic void setDriver(org.openqa.selenium.WebDriver driver)
driver - WebDriver.public void prepareWebDriver()
ContextprepareWebDriver in interface Contextpublic void setWebDriverPreparator(WebDriverPreparator preparator)
preparator - WebDriverPreparator.public String getBrowserName()
ContextgetBrowserName in interface Contextpublic void setScreenshotDir(String screenshotDir) throws IllegalArgumentException
screenshotDir - directory.IllegalArgumentException - throws if screenshotDir is not directory.public void setScreenshotAllDir(String screenshotAllDir) throws IllegalArgumentException
screenshotAllDir - directory.IllegalArgumentException - throws if screenshotAllDir is not directory.public void setScreenshotOnFailDir(String screenshotOnFailDir)
screenshotOnFailDir - directory.public String getCurrentBaseURL()
ContextgetCurrentBaseURL in interface Contextpublic void setOverridingBaseURL(String overridingBaseURL)
overridingBaseURL - base URL.public String getOverridingBaseURL()
ContextgetOverridingBaseURL in interface Contextpublic void setIgnoredScreenshotCommand(boolean isIgnoredScreenshotCommand)
isIgnoredScreenshotCommand - set true if you want to ignore "captureEntirePageScreenshot"public boolean isIgnoredScreenshotCommand()
ScreenshotHandlerisIgnoredScreenshotCommand in interface ScreenshotHandlerpublic boolean isHighlight()
HighlightHandlerisHighlight in interface HighlightHandlerpublic void setHighlight(boolean isHighlight)
isHighlight - true if use locator highlighting.public boolean isInteractive()
ContextisInteractive in interface Contextpublic void setInteractive(boolean isInteractive)
isInteractive - true if Runner executes test step-by-step upon user key stroke.public int getTimeout()
ContextgetTimeout in interface Contextpublic void setTimeout(int timeout)
ContextsetTimeout in interface Contexttimeout - for waiting.public long getInitialSpeed()
public void setInitialSpeed(long initialSpeed)
initialSpeed - initial speed.public void resetSpeed()
ContextresetSpeed in interface Contextpublic long getSpeed()
Contextpublic void setSpeed(long speed)
Contextpublic void waitSpeed()
Contextpublic SubCommandMap getSubCommandMap()
ContextgetSubCommandMap in interface Contextpublic CommandFactory getCommandFactory()
ContextgetCommandFactory in interface Contextpublic CommandListIterator getCommandListIterator()
ContextgetCommandListIterator in interface Contextpublic void pushCommandListIterator(CommandListIterator commandListIterator)
ContextpushCommandListIterator in interface ContextcommandListIterator - CommanListIterator.public void popCommandListIterator()
ContextpopCommandListIterator in interface Contextpublic VarsMap getVarsMap()
ContextgetVarsMap in interface Contextpublic void setVarsMap(VarsMap varsMap)
varsMap - the evaluated variables (state) for the current context.public CollectionMap getCollectionMap()
ContextgetCollectionMap in interface Contextpublic RollupRules getRollupRules()
ContextgetRollupRules in interface Contextpublic WebDriverElementFinder getElementFinder()
ContextgetElementFinder in interface Contextpublic PageInformation getLatestPageInformation()
ContextgetLatestPageInformation in interface Contextpublic void setLatestPageInformation(PageInformation pageInformation)
ContextsetLatestPageInformation in interface ContextpageInformation - page information.public CookieFilter getCookieFilter()
ContextgetCookieFilter in interface Contextpublic void setCookieFilter(CookieFilter cookieFilter)
ContextsetCookieFilter in interface ContextcookieFilter - cookie filter.public JSLibrary getJSLibrary()
ContextgetJSLibrary in interface Contextpublic void setJSLibrary(JSLibrary jsLibrary)
ContextsetJSLibrary in interface ContextjsLibrary - JavaScript library handler.public ModifierKeyState getModifierKeyState()
ContextgetModifierKeyState in interface Contextpublic void resetState()
ContextresetState in interface Contextpublic Result execute(Selenese selenese)
selenese - test-suite or test-case.public boolean isTrue(String expr)
Contextpublic Result run(String... filenames)
filenames - Selenese script filenames.public Result run(String filename, InputStream is)
filename - selenese script file. (not open. used for label or generating output filename)is - input stream of script file. (test-case or test-suite)public void setJUnitResultDir(String dir)
dir - JUnit result directory.public JUnitResult getJUnitResult()
JUnitResultHoldergetJUnitResult in interface JUnitResultHolderpublic void setHtmlResultDir(String dir)
dir - HTML result directory.public HtmlResult getHtmlResult()
HtmlResultHoldergetHtmlResult in interface HtmlResultHolderpublic void finish()
public void highlight(Locator ploc, HighlightStyle highlightStyle)
HighlightHandlerhighlight in interface HighlightHandlerploc - parsed locator.highlightStyle - highlight style.public void unhighlight()
HighlightHandlerunhighlight in interface HighlightHandlerCopyright © 2017. All rights reserved.