Class DefaultDriverProvider
- java.lang.Object
-
- org.openqa.selenium.remote.server.DefaultDriverProvider
-
- All Implemented Interfaces:
DriverProvider
public class DefaultDriverProvider extends java.lang.Object implements DriverProvider
This driver provider uses reflection to find and call a driver constructor that accepts a parameter of Capabilities type.
-
-
Constructor Summary
Constructors Constructor Description DefaultDriverProvider(org.openqa.selenium.Capabilities capabilities, java.lang.Class<? extends org.openqa.selenium.WebDriver> driverClass)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanCreateDriverInstanceFor(org.openqa.selenium.Capabilities capabilities)Checks that the browser name set in the provided capabilities matches the browser name set in the desired capabilities.static DriverProvidercreateProvider(org.openqa.selenium.Capabilities capabilities, java.lang.String driverClassName)org.openqa.selenium.CapabilitiesgetProvidedCapabilities()The provider "promises" that created driver instances will have (at least) this set of capabilities.org.openqa.selenium.WebDrivernewInstance(org.openqa.selenium.Capabilities capabilities)Creates a new driver instance.java.lang.StringtoString()
-
-
-
Method Detail
-
createProvider
public static DriverProvider createProvider(org.openqa.selenium.Capabilities capabilities, java.lang.String driverClassName)
-
getProvidedCapabilities
public org.openqa.selenium.Capabilities getProvidedCapabilities()
Description copied from interface:DriverProviderThe provider "promises" that created driver instances will have (at least) this set of capabilities. The grid uses this information to match the capabilities requested by the client against the capabilities provided by all registered providers to pick the "best" one.- Specified by:
getProvidedCapabilitiesin interfaceDriverProvider- Returns:
- capabilities provided
-
canCreateDriverInstanceFor
public boolean canCreateDriverInstanceFor(org.openqa.selenium.Capabilities capabilities)
Checks that the browser name set in the provided capabilities matches the browser name set in the desired capabilities.- Specified by:
canCreateDriverInstanceForin interfaceDriverProvider- Parameters:
capabilities- The desired capabilities- Returns:
- true if the browser name is the same, false otherwise
-
newInstance
public org.openqa.selenium.WebDriver newInstance(org.openqa.selenium.Capabilities capabilities)
Description copied from interface:DriverProviderCreates a new driver instance. The specified capabilities are to be passed to the driver constructor.- Specified by:
newInstancein interfaceDriverProvider- Parameters:
capabilities- Capabilities are to be passed to the driver constructor.- Returns:
- A new driver instance
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-