public class WebDriverRunner
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CHROME |
static java.lang.String |
FIREFOX |
static java.lang.String |
HTMLUNIT
To use HtmlUnitDriver, you need to include extra dependency to your project:
|
static java.lang.String |
INTERNET_EXPLORER |
static java.lang.String |
OPERA
To use OperaDriver, you need to include extra dependency to your project:
<dependency org="com.opera" name="operadriver" rev="1.5" conf="test->default"/>
|
static java.lang.String |
PHANTOMJS
To use PhantomJS, you need to include extra dependency to your project:
<dependency org="com.github.detro.ghostdriver" name="phantomjsdriver" rev="1.+" conf="test->default"/>
|
static ScreenShotLaboratory |
screenshots |
static WebDriverThreadLocalContainer |
webdriverContainer |
| Constructor and Description |
|---|
WebDriverRunner() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addListener(org.openqa.selenium.support.events.WebDriverEventListener listener)
Use this method BEFORE opening a browser to add custom event listeners to webdriver.
|
static void |
clearBrowserCache()
Delete all the browser cookies
|
static void |
closeWebDriver()
Close the browser if it's open
|
static org.openqa.selenium.WebDriver |
getWebDriver()
Get the underlying instance of Selenium WebDriver.
|
static boolean |
htmlUnit()
Is Selenide configured to use HtmlUnit browser
|
static boolean |
ie()
Is Selenide configured to use Internet Explorer browser
|
static boolean |
isHeadless()
Is Selenide configured to use headless browser (HtmlUnit or PhantomJS)
|
static boolean |
phantomjs()
Is Selenide configured to use PhantomJS browser
|
static void |
setWebDriver(org.openqa.selenium.WebDriver webDriver)
Tell Selenide use your provided WebDriver instance.
|
static java.lang.String |
source() |
static java.lang.String |
takeScreenShot(java.lang.String fileName) |
static java.lang.String |
takeScreenShot(java.lang.String className,
java.lang.String methodName) |
static java.lang.String |
url() |
public static WebDriverThreadLocalContainer webdriverContainer
public static ScreenShotLaboratory screenshots
public static final java.lang.String CHROME
public static final java.lang.String INTERNET_EXPLORER
public static final java.lang.String FIREFOX
public static final java.lang.String HTMLUNIT
java -Dbrowser=htmlunit:firefox
java -Dbrowser=htmlunit:chrome
java -Dbrowser=htmlunit:internet explorer (default)
etc.public static final java.lang.String PHANTOMJS
public static final java.lang.String OPERA
public static void addListener(org.openqa.selenium.support.events.WebDriverEventListener listener)
listener - your listener of webdriver eventspublic static void setWebDriver(org.openqa.selenium.WebDriver webDriver)
open(url).
Otherwise Selenide will create its own WebDriver instance and would not close it.
P.S. Alternatively, you can run tests with system property
-Dbrowser=com.my.WebDriverFactorywhich should implement interface com.codeborne.selenide.WebDriverProvider
public static org.openqa.selenium.WebDriver getWebDriver()
public static void closeWebDriver()
public static boolean ie()
public static boolean isHeadless()
public static boolean htmlUnit()
public static boolean phantomjs()
public static void clearBrowserCache()
public static java.lang.String source()
public static java.lang.String url()
public static java.lang.String takeScreenShot(java.lang.String className,
java.lang.String methodName)
public static java.lang.String takeScreenShot(java.lang.String fileName)