类 WebConnectionHtmlUnitDriver
- java.lang.Object
- org.openqa.selenium.htmlunit.HtmlUnitDriver
- org.springframework.test.web.servlet.htmlunit.webdriver.WebConnectionHtmlUnitDriver
- 所有已实现的接口:
org.openqa.selenium.HasCapabilities
,org.openqa.selenium.interactions.HasInputDevices
,org.openqa.selenium.internal.FindsByClassName
,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
public class WebConnectionHtmlUnitDriver extends org.openqa.selenium.htmlunit.HtmlUnitDriver
WebConnectionHtmlUnitDriver
enables configuration of theWebConnection
for anHtmlUnitDriver
instance.This is useful because it allows a
MockMvcWebConnection
to be injected.- 从以下版本开始:
- 4.2
- 作者:
- Rob Winch, Sam Brannen
- 另请参阅:
MockMvcHtmlUnitDriverBuilder
构造器概要
构造器 构造器 说明 WebConnectionHtmlUnitDriver()
WebConnectionHtmlUnitDriver(boolean enableJavascript)
WebConnectionHtmlUnitDriver(com.gargoylesoftware.htmlunit.BrowserVersion browserVersion)
WebConnectionHtmlUnitDriver(org.openqa.selenium.Capabilities capabilities)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 com.gargoylesoftware.htmlunit.WebClient
getWebClient()
Return the currentWebClient
.com.gargoylesoftware.htmlunit.WebConnection
getWebConnection()
Access the currentWebConnection
for theWebClient
.protected com.gargoylesoftware.htmlunit.WebClient
modifyWebClient(com.gargoylesoftware.htmlunit.WebClient webClient)
Modify the suppliedWebClient
and retain a reference to it so that itsWebConnection
is accessible for later use.protected com.gargoylesoftware.htmlunit.WebClient
modifyWebClientInternal(com.gargoylesoftware.htmlunit.WebClient webClient)
Modify the suppliedWebClient
.void
setWebConnection(com.gargoylesoftware.htmlunit.WebConnection webConnection)
Set theWebConnection
to be used with theWebClient
.从类继承的方法 org.openqa.selenium.htmlunit.HtmlUnitDriver
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, getKeyboard, getMouse, getPageSource, getTitle, getWindowHandle, getWindowHandles, implicitlyWaitFor, isJavascriptEnabled, lastPage, manage, navigate, newHtmlUnitWebElement, newWebClient, pickWindow, quit, setAutoProxy, setHTTPProxy, setJavascriptEnabled, setProxy, setProxySettings, setSocksProxy, setSocksProxy, switchTo
构造器详细资料
WebConnectionHtmlUnitDriver
public WebConnectionHtmlUnitDriver()
WebConnectionHtmlUnitDriver
public WebConnectionHtmlUnitDriver(com.gargoylesoftware.htmlunit.BrowserVersion browserVersion)
WebConnectionHtmlUnitDriver
public WebConnectionHtmlUnitDriver(boolean enableJavascript)
WebConnectionHtmlUnitDriver
public WebConnectionHtmlUnitDriver(org.openqa.selenium.Capabilities capabilities)
方法详细资料
modifyWebClient
protected final com.gargoylesoftware.htmlunit.WebClient modifyWebClient(com.gargoylesoftware.htmlunit.WebClient webClient)
Modify the suppliedWebClient
and retain a reference to it so that itsWebConnection
is accessible for later use.Delegates to
HtmlUnitDriver.modifyWebClient(com.gargoylesoftware.htmlunit.WebClient)
for default behavior and tomodifyWebClientInternal(com.gargoylesoftware.htmlunit.WebClient)
for further customization.- 覆盖:
modifyWebClient
在类中org.openqa.selenium.htmlunit.HtmlUnitDriver
- 参数:
webClient
- the client to modify- 返回:
- the modified client
- 另请参阅:
HtmlUnitDriver.modifyWebClient(WebClient)
,modifyWebClientInternal(WebClient)
modifyWebClientInternal
protected com.gargoylesoftware.htmlunit.WebClient modifyWebClientInternal(com.gargoylesoftware.htmlunit.WebClient webClient)
Modify the suppliedWebClient
.The default implementation simply returns the supplied client unmodified.
Subclasses can override this method to customize the
WebClient
that theHtmlUnitDriver
uses.- 参数:
webClient
- the client to modify- 返回:
- the modified client
getWebClient
public com.gargoylesoftware.htmlunit.WebClient getWebClient()
Return the currentWebClient
.- 覆盖:
getWebClient
在类中org.openqa.selenium.htmlunit.HtmlUnitDriver
- 从以下版本开始:
- 4.3
setWebConnection
public void setWebConnection(com.gargoylesoftware.htmlunit.WebConnection webConnection)
Set theWebConnection
to be used with theWebClient
.- 参数:
webConnection
- theWebConnection
to use
getWebConnection
public com.gargoylesoftware.htmlunit.WebConnection getWebConnection()
Access the currentWebConnection
for theWebClient
.- 返回:
- the current
WebConnection