Package jp.vmi.selenium.webdriver
Class WebDriverFactory
java.lang.Object
jp.vmi.selenium.webdriver.WebDriverFactory
- Direct Known Subclasses:
AppiumWebDriverFactory,ChromeDriverFactory,EdgeDriverFactory,FirefoxDriverFactory,HtmlUnitDriverFactory,IEDriverFactory,PhantomJSDriverFactory,RemoteWebDriverFactory,SafariDriverFactory
public abstract class WebDriverFactory extends Object
Abstract class of factoryName for
WebDrivers.-
Field Summary
Fields Modifier and Type Field Description protected static intDEFAULT_HEIGHTprotected static intDEFAULT_WIDTH -
Constructor Summary
Constructors Constructor Description WebDriverFactory() -
Method Summary
Modifier and Type Method Description booleanequals(Object obj)StringgetBrowserName()Get browser name.protected org.openqa.selenium.DimensiongetDefaultWindowSize(org.openqa.selenium.WebDriver driver)booleanisProxySupported()Is proxy supported?abstract org.openqa.selenium.WebDrivernewInstance(DriverOptions driverOptions)Create new WebDriver instance with driver options.static org.openqa.selenium.ProxynewProxy(DriverOptions driverOptions)Create new Proxy from driver options.protected voidsetInitialWindowSize(org.openqa.selenium.WebDriver driver, DriverOptions driverOptions)static <B extends org.openqa.selenium.remote.service.DriverService.Builder<?, B>>
BsetupBuilder(B builder, DriverOptions driverOptions, DriverOptions.DriverOption driverKey)Setup builder for DriverService.protected org.openqa.selenium.remote.DesiredCapabilitiessetupProxy(org.openqa.selenium.remote.DesiredCapabilities caps, DriverOptions driverOptions)StringtoString()
-
Field Details
-
DEFAULT_WIDTH
protected static final int DEFAULT_WIDTH- See Also:
- Constant Field Values
-
DEFAULT_HEIGHT
protected static final int DEFAULT_HEIGHT- See Also:
- Constant Field Values
-
-
Constructor Details
-
WebDriverFactory
public WebDriverFactory()
-
-
Method Details
-
getBrowserName
Get browser name.- Returns:
- browser name. (i.e. "firefox", "chrome", ...)
-
isProxySupported
public boolean isProxySupported()Is proxy supported?- Returns:
- true if proxy is supported by driver.
-
setupBuilder
public static <B extends org.openqa.selenium.remote.service.DriverService.Builder<?, B>> B setupBuilder(B builder, DriverOptions driverOptions, DriverOptions.DriverOption driverKey)Setup builder for DriverService.- Type Parameters:
B- subclass of DriverService.Builder- Parameters:
builder- DriverService builder.driverOptions- driver options.driverKey- driver option (e.g. '--firefox', '--chrome')- Returns:
- setup builder.
-
newProxy
Create new Proxy from driver options.- Parameters:
driverOptions- driver options.- Returns:
- Proxy or null.
-
setupProxy
protected org.openqa.selenium.remote.DesiredCapabilities setupProxy(org.openqa.selenium.remote.DesiredCapabilities caps, DriverOptions driverOptions) -
newInstance
Create new WebDriver instance with driver options.- Parameters:
driverOptions- driver options.- Returns:
- WebDriver instance.
-
setInitialWindowSize
protected void setInitialWindowSize(org.openqa.selenium.WebDriver driver, DriverOptions driverOptions) -
getDefaultWindowSize
protected org.openqa.selenium.Dimension getDefaultWindowSize(org.openqa.selenium.WebDriver driver) -
toString
-
equals
-