Class 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
      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.
      static DriverProvider createProvider​(org.openqa.selenium.Capabilities capabilities, java.lang.String driverClassName)  
      org.openqa.selenium.Capabilities getProvidedCapabilities()
      The provider "promises" that created driver instances will have (at least) this set of capabilities.
      org.openqa.selenium.WebDriver newInstance​(org.openqa.selenium.Capabilities capabilities)
      Creates a new driver instance.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DefaultDriverProvider

        public DefaultDriverProvider​(org.openqa.selenium.Capabilities capabilities,
                                     java.lang.Class<? extends org.openqa.selenium.WebDriver> driverClass)
    • 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: DriverProvider
        The 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:
        getProvidedCapabilities in interface DriverProvider
        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:
        canCreateDriverInstanceFor in interface DriverProvider
        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: DriverProvider
        Creates a new driver instance. The specified capabilities are to be passed to the driver constructor.
        Specified by:
        newInstance in interface DriverProvider
        Parameters:
        capabilities - Capabilities are to be passed to the driver constructor.
        Returns:
        A new driver instance
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object