com.atlassian.webdriver
Class LifecycleAwareWebDriverGrid

java.lang.Object
  extended by com.atlassian.webdriver.LifecycleAwareWebDriverGrid

public class LifecycleAwareWebDriverGrid
extends Object

Simple lifecycle aware Webdriver helper that will setup auto browsers and then retrieve a driver from the factory. Once the driver is running it will be re-used if the same browser property is retrieved again.

When the runtime is shutdown it will handle cleaning up the browser. It also provides a way to manually quit all the registered drivers/browsers via shutdown(). When that method is called, the shutdown hooks for those browser will be unregistered.

Since:
2.1

Method Summary
static com.google.common.base.Supplier<AtlassianWebDriver> currentDriverSupplier()
           
static AtlassianWebDriver getCurrentDriver()
           
static AtlassianWebDriver getDriver()
          Retrieves the driver from the WebDriverFactory.
static void shutdown()
          A manual shut down of the registered drivers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDriver

public static AtlassianWebDriver getDriver()
Retrieves the driver from the WebDriverFactory. If an instance of the driver is already running then it will be re-used instead of creating a new instance.

Returns:
an instance of the driver

getCurrentDriver

public static AtlassianWebDriver getCurrentDriver()

currentDriverSupplier

public static com.google.common.base.Supplier<AtlassianWebDriver> currentDriverSupplier()

shutdown

public static void shutdown()
A manual shut down of the registered drivers. This basically resets the grid to a blank state. The shutdown hooks for the drivers that have been closed are also removed.



Copyright © 2014 Atlassian. All rights reserved.