public class SetupDriver extends Object
Uses RemoteDriver or LocalDriver to provide remote or local
WebDriver to run tests on.
RemoteDriver and LocalDriver can be subclassed in order to
extend their functionalities.
| Constructor and Description |
|---|
SetupDriver() |
| Modifier and Type | Method and Description |
|---|---|
org.openqa.selenium.remote.DesiredCapabilities |
getDesiredCapabilities()
Used to determine which capabilities should be used when setting up a
WebDriver for this test. |
void |
setDesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities)
Sets the requested browser capabilities (typically browser name and
version)
|
org.openqa.selenium.WebDriver |
setupLocalDriver()
Sets up and returns a
WebDriver to run test. |
org.openqa.selenium.WebDriver |
setupLocalDriver(Browser runLocallyBrowser)
Sets up and returns a
WebDriver to run test. |
org.openqa.selenium.WebDriver |
setupLocalDriver(Browser runLocallyBrowser,
String version)
Sets up and returns a
WebDriver to run test. |
org.openqa.selenium.WebDriver |
setupRemoteDriver(RemoteDriver remoteDriver,
String hubURL)
Sets up and returns a
WebDriver to run test on hubURL. |
org.openqa.selenium.WebDriver |
setupRemoteDriver(String hubURL)
Sets up and returns a
WebDriver to run test on hubURL. |
public org.openqa.selenium.WebDriver setupRemoteDriver(RemoteDriver remoteDriver, String hubURL) throws Exception
Sets up and returns a WebDriver to run test on hubURL.
The test must set the driver through
TestBenchTestCase.setDriver(org.openqa.selenium.WebDriver)
remoteDriver - RemoteDriver instance to use to setup the
WebDriverhubURL - URL of the Hub to run the tests onWebDriver properly setupException - If anything goes wrongpublic org.openqa.selenium.WebDriver setupRemoteDriver(String hubURL) throws Exception
WebDriver to run test on hubURL. TestBenchTestCase.setDriver(org.openqa.selenium.WebDriver)hubURL - URL of the Hub to run the tests onWebDriver properly setupException - If anything goes wrongpublic org.openqa.selenium.WebDriver setupLocalDriver()
Sets up and returns a WebDriver to run test.
The test will run on browser specified by
getDesiredCapabilities()
The test must set the driver through
TestBenchTestCase.setDriver(org.openqa.selenium.WebDriver)
WebDriver properly setuppublic org.openqa.selenium.WebDriver setupLocalDriver(Browser runLocallyBrowser, String version)
Sets up and returns a WebDriver to run test. This driver will run
the test on the Browser provided in the RunLocally
annotation.
runLocallyBrowser - Browser to run test onversion - version of the browserWebDriver properly setuppublic org.openqa.selenium.WebDriver setupLocalDriver(Browser runLocallyBrowser)
Sets up and returns a WebDriver to run test. This driver will run
the test on the Browser provided in the RunLocally
annotation.
runLocallyBrowser - Browser to run test onWebDriver properly setuppublic org.openqa.selenium.remote.DesiredCapabilities getDesiredCapabilities()
WebDriver for this test. Typically set by a test runner or left
at its default (Firefox 24). If you want to run a test on a single
browser other than Firefox 24 you can override this method.public void setDesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities)
desiredCapabilities - Copyright © 2018. All rights reserved.