public class WebConnectionHtmlUnitDriver
extends org.openqa.selenium.htmlunit.HtmlUnitDriver
WebConnectionHtmlUnitDriver
enables configuration of the
WebConnection
for an HtmlUnitDriver
instance.
This is useful because it allows a
MockMvcWebConnection
to be injected.
MockMvcHtmlUnitDriverBuilder
org.openqa.selenium.htmlunit.HtmlUnitDriver.HtmlUnitWindow, org.openqa.selenium.htmlunit.HtmlUnitDriver.JavaScriptResultsCollection
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
Constructor and Description |
---|
WebConnectionHtmlUnitDriver() |
WebConnectionHtmlUnitDriver(boolean enableJavascript) |
WebConnectionHtmlUnitDriver(com.gargoylesoftware.htmlunit.BrowserVersion browserVersion) |
WebConnectionHtmlUnitDriver(org.openqa.selenium.Capabilities capabilities) |
Modifier and Type | Method and Description |
---|---|
com.gargoylesoftware.htmlunit.WebClient |
getWebClient()
Return the current
WebClient in a public fashion. |
com.gargoylesoftware.htmlunit.WebConnection |
getWebConnection()
Access the current
WebConnection for the WebClient . |
protected com.gargoylesoftware.htmlunit.WebClient |
modifyWebClient(com.gargoylesoftware.htmlunit.WebClient webClient)
Modify the supplied
WebClient and retain a reference to it so that its
WebConnection is accessible for later use. |
protected com.gargoylesoftware.htmlunit.WebClient |
modifyWebClientInternal(com.gargoylesoftware.htmlunit.WebClient webClient)
Modify the supplied
WebClient . |
void |
setWebConnection(com.gargoylesoftware.htmlunit.WebConnection webConnection)
Set the
WebConnection to be used with the WebClient . |
assertElementNotStale, close, executeAsyncScript, executeScript, findElement, findElementByClassName, findElementByCssSelector, findElementById, findElementByLinkText, findElementByName, findElementByPartialLinkText, findElementByTagName, findElementByXPath, findElements, findElementsByClassName, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByName, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, get, get, getBrowserVersion, getCapabilities, getCurrentUrl, getCurrentWindow, getElementById, getKeyboard, getMouse, getPageSource, getTitle, getWindowHandle, getWindowHandles, implicitlyWaitFor, isAcceptSslCertificates, isDownloadImages, isJavascriptEnabled, lastPage, manage, navigate, newWebClient, pickWindow, quit, setAcceptSslCertificates, setAutoProxy, setDownloadImages, setExecutor, setHTTPProxy, setJavascriptEnabled, setProxy, setProxySettings, setSocksProxy, setSocksProxy, switchTo, toWebElement
public WebConnectionHtmlUnitDriver()
public WebConnectionHtmlUnitDriver(com.gargoylesoftware.htmlunit.BrowserVersion browserVersion)
public WebConnectionHtmlUnitDriver(boolean enableJavascript)
public WebConnectionHtmlUnitDriver(org.openqa.selenium.Capabilities capabilities)
protected final com.gargoylesoftware.htmlunit.WebClient modifyWebClient(com.gargoylesoftware.htmlunit.WebClient webClient)
WebClient
and retain a reference to it so that its
WebConnection
is accessible for later use.
Delegates to HtmlUnitDriver.modifyWebClient(com.gargoylesoftware.htmlunit.WebClient)
for default behavior
and to modifyWebClientInternal(com.gargoylesoftware.htmlunit.WebClient)
for further customization.
modifyWebClient
in class org.openqa.selenium.htmlunit.HtmlUnitDriver
webClient
- the client to modifyHtmlUnitDriver.modifyWebClient(WebClient)
,
modifyWebClientInternal(WebClient)
protected com.gargoylesoftware.htmlunit.WebClient modifyWebClientInternal(com.gargoylesoftware.htmlunit.WebClient webClient)
WebClient
.
The default implementation simply returns the supplied client unmodified.
Subclasses can override this method to customize the WebClient
that the HtmlUnitDriver
uses.
webClient
- the client to modifypublic com.gargoylesoftware.htmlunit.WebClient getWebClient()
WebClient
in a public fashion.getWebClient
in class org.openqa.selenium.htmlunit.HtmlUnitDriver
public void setWebConnection(com.gargoylesoftware.htmlunit.WebConnection webConnection)
WebConnection
to be used with the WebClient
.webConnection
- the WebConnection
to usepublic com.gargoylesoftware.htmlunit.WebConnection getWebConnection()
WebConnection
for the WebClient
.WebConnection