类 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
WebConnectionHtmlUnitDriverenables configuration of theWebConnectionfor anHtmlUnitDriverinstance.This is useful because it allows a
MockMvcWebConnectionto 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.WebClientgetWebClient()Return the currentWebClient.com.gargoylesoftware.htmlunit.WebConnectiongetWebConnection()Access the currentWebConnectionfor theWebClient.protected com.gargoylesoftware.htmlunit.WebClientmodifyWebClient(com.gargoylesoftware.htmlunit.WebClient webClient)Modify the suppliedWebClientand retain a reference to it so that itsWebConnectionis accessible for later use.protected com.gargoylesoftware.htmlunit.WebClientmodifyWebClientInternal(com.gargoylesoftware.htmlunit.WebClient webClient)Modify the suppliedWebClient.voidsetWebConnection(com.gargoylesoftware.htmlunit.WebConnection webConnection)Set theWebConnectionto 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, 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
构造器详细资料
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 suppliedWebClientand retain a reference to it so that itsWebConnectionis 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
WebClientthat theHtmlUnitDriveruses.- 参数:
 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 theWebConnectionto be used with theWebClient.- 参数:
 webConnection- theWebConnectionto use
getWebConnection
public com.gargoylesoftware.htmlunit.WebConnection getWebConnection()
Access the currentWebConnectionfor theWebClient.- 返回:
 - the current 
WebConnection