-
- All Implemented Interfaces:
-
org.openqa.selenium.HasCapabilities,org.openqa.selenium.JavascriptExecutor,org.openqa.selenium.PrintsPage,org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebDriver,org.openqa.selenium.interactions.HasInputDevices,org.openqa.selenium.interactions.Interactive,org.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator
public final class MockWebDriver extends RemoteWebDriver
-
-
Field Summary
Fields Modifier and Type Field Description private StringmockPageSourceprivate final RemoteWebDriverrealDriverprivate final BrowserTypebrowserTypeprivate final BooleansupportJavascriptprivate final BooleanisMockedPageSource
-
Constructor Summary
Constructors Constructor Description MockWebDriver(Function0<ChromeDevtoolsDriver> backupDriverCreator)
-
Method Summary
Modifier and Type Method Description final StringgetMockPageSource()final UnitsetMockPageSource(String mockPageSource)final RemoteWebDrivergetRealDriver()final BrowserTypegetBrowserType()final BooleangetSupportJavascript()final BooleangetIsMockedPageSource()Unitget(String url)final UnitstopLoading()final Objectevaluate(String expression)ObjectexecuteScript(String script, Object args)SessionIdgetSessionId()StringgetCurrentUrl()Set<String>getWindowHandles()StringgetPageSource()final UnitbringToFront()<X extends Any> XgetScreenshotAs(OutputType<X> outputType)StringtoString()Unitquit()Quit the browser instance Unitclose()Close the tab hold by this driver -
Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver
executeScript, getPinnedScripts, pin, unpin -
Methods inherited from class ai.platon.pulsar.protocol.browser.driver.test.MockWebDriver
addVirtualAuthenticator, execute, execute, execute, executeAsyncScript, findElement, findElement, findElement, findElements, findElements, findElements, getCapabilities, getCommandExecutor, getElementConverter, getErrorHandler, getExecuteMethod, getFileDetector, getKeyboard, getMouse, getTitle, getWindowHandle, log, manage, navigate, perform, print, removeVirtualAuthenticator, resetInputState, setCommandExecutor, setElementConverter, setErrorHandler, setFileDetector, setFoundBy, setLogLevel, setSessionId, startSession, switchTo -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
MockWebDriver
MockWebDriver(Function0<ChromeDevtoolsDriver> backupDriverCreator)
-
-
Method Detail
-
getMockPageSource
final String getMockPageSource()
-
setMockPageSource
final Unit setMockPageSource(String mockPageSource)
-
getRealDriver
final RemoteWebDriver getRealDriver()
-
getBrowserType
final BrowserType getBrowserType()
-
getSupportJavascript
final Boolean getSupportJavascript()
-
getIsMockedPageSource
final Boolean getIsMockedPageSource()
-
stopLoading
final Unit stopLoading()
-
executeScript
Object executeScript(String script, Object args)
-
getSessionId
SessionId getSessionId()
-
getCurrentUrl
String getCurrentUrl()
-
getWindowHandles
Set<String> getWindowHandles()
-
getPageSource
String getPageSource()
-
bringToFront
final Unit bringToFront()
-
getScreenshotAs
<X extends Any> X getScreenshotAs(OutputType<X> outputType)
-
-
-
-