com.saucelabs.selenium.client.factory.spi
Class SeleniumFactorySPI

java.lang.Object
  extended by com.saucelabs.selenium.client.factory.spi.SeleniumFactorySPI
Direct Known Subclasses:
DefaultSeleniumSPIImpl, EmbeddedRcSPIImpl, HtmlUnitSPIImpl, LoggingSeleniumSPIImpl, SauceOnDemandSPIImpl

public abstract class SeleniumFactorySPI
extends Object

SPI implemented by the Selenium driver implementation providers.

Concrete implementations of this SPI must have a public no-argument constructor. Instances of SeleniumFactorySPIs are discovered via /META-INF/services, see the spec for details of the service lookup.

Author:
Kohsuke Kawaguchi

Constructor Summary
SeleniumFactorySPI()
           
 
Method Summary
abstract  com.thoughtworks.selenium.Selenium createSelenium(SeleniumFactory factory, String browserURL)
          Instantiates the driver.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeleniumFactorySPI

public SeleniumFactorySPI()
Method Detail

createSelenium

public abstract com.thoughtworks.selenium.Selenium createSelenium(SeleniumFactory factory,
                                                                  String browserURL)
Instantiates the driver.

This method is invoked in response to SeleniumFactory.createSelenium() to actually instantiate the driver.

Parameters:
factory - The factory that captures the configuration that the calling user application is looking for. Never null.
browserURL - See the parameter of the same name in DefaultSelenium.DefaultSelenium(String, int, String, String). This specifies the domain name in the format of "http://foo.example.com" where the test occurs.
Returns:
null if the implementation didn't recognize the URI specified in the factory. returning null causes SeleniumFactory to try other SPIs found in the system.
Throws:
IllegalArgumentException - If the URI was recognized by the SPI but some of its configurations were wrong, or if the SPI failed to instantiate the Selenium driver, throw an exception. SeleniumFactory will not try other SPIs and propagate the problem to the calling user application.


Copyright © 2010. All Rights Reserved.