org.specrunner.webdriver
Class HtmlUnitDriverLocal

java.lang.Object
  extended by org.openqa.selenium.htmlunit.HtmlUnitDriver
      extended by org.specrunner.webdriver.HtmlUnitDriverLocal
All Implemented Interfaces:
org.openqa.selenium.HasCapabilities, org.openqa.selenium.interactions.HasInputDevices, org.openqa.selenium.internal.FindsByCssSelector, org.openqa.selenium.internal.FindsById, org.openqa.selenium.internal.FindsByLinkText, org.openqa.selenium.internal.FindsByName, org.openqa.selenium.internal.FindsByTagName, org.openqa.selenium.internal.FindsByXPath, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.WebDriver, IHtmlUnitDriver

public class HtmlUnitDriverLocal
extends org.openqa.selenium.htmlunit.HtmlUnitDriver
implements IHtmlUnitDriver

Implementation for HtmlUnitDriver which enable recovering WebClient instance.

Author:
Thiago Santos

Nested Class Summary
 
Nested classes/interfaces inherited from class org.openqa.selenium.htmlunit.HtmlUnitDriver
org.openqa.selenium.htmlunit.HtmlUnitDriver.HtmlUnitWindow, org.openqa.selenium.htmlunit.HtmlUnitDriver.JavaScriptResultsCollection
 
Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver
org.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window
 
Field Summary
 
Fields inherited from class org.openqa.selenium.htmlunit.HtmlUnitDriver
INVALIDSELECTIONERROR, INVALIDXPATHERROR
 
Constructor Summary
HtmlUnitDriverLocal()
          Default constructor.
HtmlUnitDriverLocal(boolean enableJavascript)
          Creates the client with JS enabled or not.
HtmlUnitDriverLocal(com.gargoylesoftware.htmlunit.BrowserVersion version)
          Creates a client with a given version.
HtmlUnitDriverLocal(org.openqa.selenium.Capabilities capabilities)
          Creates a driver with preset capabilities.
 
Method Summary
 com.gargoylesoftware.htmlunit.WebClient getWebClient()
          Return the webdriver client.
 void initialize()
          Perform some missing initialization on webclient.
 void setHeader(String name, String value)
          Adds a header to the client.
 
Methods inherited from class org.openqa.selenium.htmlunit.HtmlUnitDriver
assertElementNotStale, close, executeAsyncScript, executeScript, findElement, findElementByCssSelector, findElementById, findElementByLinkText, findElementByName, findElementByPartialLinkText, findElementByTagName, findElementByXPath, findElements, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByName, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, get, get, getCapabilities, getCurrentUrl, getCurrentWindow, getKeyboard, getMouse, getPageSource, getTitle, getWindowHandle, getWindowHandles, implicitlyWaitFor, isJavascriptEnabled, lastPage, manage, modifyWebClient, navigate, newHtmlUnitWebElement, newWebClient, pickWindow, quit, setAutoProxy, setHTTPProxy, setJavascriptEnabled, setProxy, setProxySettings, setSocksProxy, setSocksProxy, switchTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlUnitDriverLocal

public HtmlUnitDriverLocal()
Default constructor.


HtmlUnitDriverLocal

public HtmlUnitDriverLocal(boolean enableJavascript)
Creates the client with JS enabled or not.

Parameters:
enableJavascript - true, to enable java script, false, otherwise.

HtmlUnitDriverLocal

public HtmlUnitDriverLocal(com.gargoylesoftware.htmlunit.BrowserVersion version)
Creates a client with a given version.

Parameters:
version - The browser version.

HtmlUnitDriverLocal

public HtmlUnitDriverLocal(org.openqa.selenium.Capabilities capabilities)
Creates a driver with preset capabilities.

Parameters:
capabilities - The capabilities.
Method Detail

getWebClient

public com.gargoylesoftware.htmlunit.WebClient getWebClient()
Description copied from interface: IHtmlUnitDriver
Return the webdriver client.

Specified by:
getWebClient in interface IHtmlUnitDriver
Overrides:
getWebClient in class org.openqa.selenium.htmlunit.HtmlUnitDriver
Returns:
The client.

initialize

public void initialize()
Perform some missing initialization on webclient.


setHeader

public void setHeader(String name,
                      String value)
Adds a header to the client.

Parameters:
name - The header name.
value - The header value.


Copyright © 2013. All rights reserved.