Class ReflectiveWebDriverFactory

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Object[] args  
      protected boolean available  
      protected java.lang.String name  
      protected java.lang.Class<? extends org.openqa.selenium.WebDriver> webDriverClass  
      protected java.lang.String webDriverClassName  
    • Constructor Summary

      Constructors 
      Constructor Description
      ReflectiveWebDriverFactory​(java.lang.String name, java.lang.Class<? extends org.openqa.selenium.WebDriver> webDriverClass, java.lang.Object... args)
      Creates a new reflective web driver factory.
      ReflectiveWebDriverFactory​(java.lang.String name, java.lang.String webDriverClassName, java.lang.Object... args)
      Creates a new reflective web driver factory.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String[] getNames()
      Get the factory names.
      java.lang.Class<? extends org.openqa.selenium.WebDriver> getWebDriverClass()
      Get web driver class.
      boolean isAvailable()
      Check if the class instantiated by this factory is available.
      protected org.openqa.selenium.remote.DesiredCapabilities newDefaultCapabilities()
      Creates new default capabilities.
      protected org.openqa.selenium.WebDriver newInstance​(java.lang.Class<? extends org.openqa.selenium.WebDriver> webDriverClass, ConfigurationProperties configuration, java.lang.Object... args)
      Creates a new instance of web driver.
      org.openqa.selenium.WebDriver newWebDriver​(org.openqa.selenium.Capabilities capabilities, ConfigurationProperties configuration)
      Creates a new instance of WebDriver.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        protected java.lang.String name
      • args

        protected java.lang.Object[] args
      • webDriverClassName

        protected java.lang.String webDriverClassName
      • webDriverClass

        protected java.lang.Class<? extends org.openqa.selenium.WebDriver> webDriverClass
      • available

        protected boolean available
    • Constructor Detail

      • ReflectiveWebDriverFactory

        public ReflectiveWebDriverFactory​(java.lang.String name,
                                          java.lang.String webDriverClassName,
                                          java.lang.Object... args)
        Creates a new reflective web driver factory.
        Parameters:
        name - factory name
        webDriverClassName - web driver class name
        args - web driver class constructor arguments
      • ReflectiveWebDriverFactory

        public ReflectiveWebDriverFactory​(java.lang.String name,
                                          java.lang.Class<? extends org.openqa.selenium.WebDriver> webDriverClass,
                                          java.lang.Object... args)
        Creates a new reflective web driver factory.
        Parameters:
        name - factory name
        webDriverClass - web driver class
        args - web driver class constructor arguments
    • Method Detail

      • getWebDriverClass

        public java.lang.Class<? extends org.openqa.selenium.WebDriver> getWebDriverClass()
        Get web driver class.
        Returns:
        web driver class
      • isAvailable

        public boolean isAvailable()
        Description copied from interface: ReflectiveFactory
        Check if the class instantiated by this factory is available.
        Specified by:
        isAvailable in interface ReflectiveFactory
        Returns:
        true if the class is available.
      • newDefaultCapabilities

        protected org.openqa.selenium.remote.DesiredCapabilities newDefaultCapabilities()
        Creates new default capabilities.
        Returns:
        default capabilities
      • newWebDriver

        public org.openqa.selenium.WebDriver newWebDriver​(org.openqa.selenium.Capabilities capabilities,
                                                          ConfigurationProperties configuration)
        Description copied from interface: WebDriverFactory
        Creates a new instance of WebDriver.
        Specified by:
        newWebDriver in interface WebDriverFactory
        Parameters:
        capabilities - Desired capabilities for the web driver
        configuration - Configuration
        Returns:
        new instance of web driver
      • newInstance

        protected org.openqa.selenium.WebDriver newInstance​(java.lang.Class<? extends org.openqa.selenium.WebDriver> webDriverClass,
                                                            ConfigurationProperties configuration,
                                                            java.lang.Object... args)
                                                     throws java.lang.reflect.InvocationTargetException,
                                                            java.lang.NoSuchMethodException,
                                                            java.lang.InstantiationException,
                                                            java.lang.IllegalAccessException
        Creates a new instance of web driver.
        Parameters:
        webDriverClass - web driver class
        configuration - configuration
        args - web driver class constructor arguments
        Returns:
        new web driver instance
        Throws:
        java.lang.NoSuchMethodException - if a matching method is not found.
        java.lang.IllegalAccessException - if this Constructor object is enforcing Java language access control and the underlying constructor is inaccessible.
        java.lang.InstantiationException - if the class that declares the underlying constructor represents an abstract class.
        java.lang.reflect.InvocationTargetException - if the underlying constructor throws an exception.
      • getNames

        public java.lang.String[] getNames()
        Description copied from interface: FactoryNames
        Get the factory names.
        Specified by:
        getNames in interface FactoryNames
        Returns:
        array of factory names