Package com.intuit.karate.driver
Class DevToolsDriver
- java.lang.Object
-
- com.intuit.karate.driver.DevToolsDriver
-
-
Field Summary
Fields Modifier and Type Field Description protected WebSocketClient
client
protected Command
command
protected String
currentDialogText
protected int
currentMouseXpos
protected int
currentMouseYpos
protected boolean
domContentEventFired
protected Set<String>
framesStillLoading
protected Logger
logger
protected DriverOptions
options
protected String
rootFrameId
protected String
sessionId
-
Fields inherited from interface com.intuit.karate.driver.Driver
METHOD_NAMES
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DevToolsDriver(DriverOptions options, Command command, String webSocketUrl)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.intuit.karate.driver.Driver
above, afterScenario, below, delay, exists, highlight, highlight, highlightAll, highlightAll, input, input, input, keys, leftOf, locate, locateAll, locateAll, methodNames, mouse, mouse, mouse, near, onFailure, optional, retry, retry, retry, rightOf, screenshot, screenshot, script, scriptAll, scriptAll, scroll, setCookies, waitFor, waitForAny, waitForAny, waitForEnabled, waitForResultCount, waitForResultCount, waitForText, waitForUrl, waitUntil, waitUntil
-
Methods inherited from interface com.intuit.karate.core.Plugin
getRuntime
-
-
-
-
Field Detail
-
options
protected final DriverOptions options
-
command
protected final Command command
-
client
protected final WebSocketClient client
-
rootFrameId
protected final String rootFrameId
-
sessionId
protected String sessionId
-
domContentEventFired
protected boolean domContentEventFired
-
currentDialogText
protected String currentDialogText
-
logger
protected final Logger logger
-
currentMouseXpos
protected int currentMouseXpos
-
currentMouseYpos
protected int currentMouseYpos
-
-
Constructor Detail
-
DevToolsDriver
protected DevToolsDriver(DriverOptions options, Command command, String webSocketUrl)
-
-
Method Detail
-
nextId
public int nextId()
-
method
public DevToolsMessage method(String method)
-
send
public void send(DevToolsMessage dtm)
-
sendAndWait
public DevToolsMessage sendAndWait(DevToolsMessage dtm, java.util.function.Predicate<DevToolsMessage> condition)
-
receive
public void receive(DevToolsMessage dtm)
-
eval
protected DevToolsMessage eval(String expression)
-
evalQuickly
protected DevToolsMessage evalQuickly(String expression)
-
retryIfEnabled
protected void retryIfEnabled(String locator)
-
getRootNodeId
protected int getRootNodeId()
-
elementIds
public List elementIds(String locator)
- Specified by:
elementIds
in interfaceDriver
-
getOptions
public DriverOptions getOptions()
- Specified by:
getOptions
in interfaceDriver
-
initWindowIdAndState
protected void initWindowIdAndState()
-
getDimensions
public Map<String,Object> getDimensions()
- Specified by:
getDimensions
in interfaceDriver
-
setDimensions
public void setDimensions(Map<String,Object> map)
- Specified by:
setDimensions
in interfaceDriver
-
emulateDevice
public void emulateDevice(int width, int height, String userAgent)
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfaceDriver
-
fullscreen
public void fullscreen()
- Specified by:
fullscreen
in interfaceDriver
-
getCookies
public List<Map> getCookies()
- Specified by:
getCookies
in interfaceDriver
-
deleteCookie
public void deleteCookie(String name)
- Specified by:
deleteCookie
in interfaceDriver
-
clearCookies
public void clearCookies()
- Specified by:
clearCookies
in interfaceDriver
-
getDialogText
public String getDialogText()
- Specified by:
getDialogText
in interfaceDriver
-
screenshot
public byte[] screenshot(boolean embed)
- Specified by:
screenshot
in interfaceDriver
-
screenshot
public byte[] screenshot(String id, boolean embed)
- Specified by:
screenshot
in interfaceDriver
-
screenshotFull
public byte[] screenshotFull()
-
switchPage
public void switchPage(String titleOrUrl)
- Specified by:
switchPage
in interfaceDriver
-
switchPage
public void switchPage(int index)
- Specified by:
switchPage
in interfaceDriver
-
switchFrame
public void switchFrame(int index)
- Specified by:
switchFrame
in interfaceDriver
-
switchFrame
public void switchFrame(String locator)
- Specified by:
switchFrame
in interfaceDriver
-
enableNetworkEvents
public void enableNetworkEvents()
-
enablePageEvents
public void enablePageEvents()
-
enableRuntimeEvents
public void enableRuntimeEvents()
-
intercept
public void intercept(org.graalvm.polyglot.Value value)
-
-