Package com.intuit.karate.driver
Class DevToolsDriver
- java.lang.Object
-
- com.intuit.karate.driver.DevToolsDriver
-
-
Field Summary
Fields Modifier and Type Field Description protected WebSocketClientclientprotected Commandcommandprotected StringcurrentDialogTextprotected intcurrentMouseXposprotected intcurrentMouseYposprotected booleandomContentEventFiredprotected Set<String>framesStillLoadingprotected Loggerloggerprotected StringmainFrameIdprotected DriverOptionsoptionsprotected StringrootFrameIdprotected StringsessionId-
Fields inherited from interface com.intuit.karate.driver.Driver
METHOD_NAMES
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDevToolsDriver(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
-
mainFrameId
protected String mainFrameId
-
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:
elementIdsin interfaceDriver
-
getOptions
public DriverOptions getOptions()
- Specified by:
getOptionsin interfaceDriver
-
initWindowIdAndState
protected void initWindowIdAndState()
-
getDimensions
public Map<String,Object> getDimensions()
- Specified by:
getDimensionsin interfaceDriver
-
setDimensions
public void setDimensions(Map<String,Object> map)
- Specified by:
setDimensionsin interfaceDriver
-
emulateDevice
public void emulateDevice(int width, int height, String userAgent)
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminatedin interfaceDriver
-
fullscreen
public void fullscreen()
- Specified by:
fullscreenin interfaceDriver
-
getCookies
public List<Map> getCookies()
- Specified by:
getCookiesin interfaceDriver
-
deleteCookie
public void deleteCookie(String name)
- Specified by:
deleteCookiein interfaceDriver
-
clearCookies
public void clearCookies()
- Specified by:
clearCookiesin interfaceDriver
-
getDialogText
public String getDialogText()
- Specified by:
getDialogTextin interfaceDriver
-
screenshot
public byte[] screenshot(boolean embed)
- Specified by:
screenshotin interfaceDriver
-
screenshot
public byte[] screenshot(String id, boolean embed)
- Specified by:
screenshotin interfaceDriver
-
screenshotFull
public byte[] screenshotFull()
-
switchPage
public void switchPage(String titleOrUrl)
- Specified by:
switchPagein interfaceDriver
-
switchPage
public void switchPage(int index)
- Specified by:
switchPagein interfaceDriver
-
switchFrame
public void switchFrame(int index)
- Specified by:
switchFramein interfaceDriver
-
switchFrame
public void switchFrame(String locator)
- Specified by:
switchFramein interfaceDriver
-
enableNetworkEvents
public void enableNetworkEvents()
-
enablePageEvents
public void enablePageEvents()
-
enableRuntimeEvents
public void enableRuntimeEvents()
-
intercept
public void intercept(org.graalvm.polyglot.Value value)
-
-