Package com.intuit.karate.driver
Class WebDriver
- java.lang.Object
-
- com.intuit.karate.driver.WebDriver
-
- Direct Known Subclasses:
AppiumDriver,ChromeWebDriver,GeckoWebDriver,IeWebDriver,MsEdgeDriver,MsWebDriver,SafariWebDriver,WinAppDriver
public abstract class WebDriver extends Object implements Driver
- Author:
- pthomas3
-
-
Field Summary
Fields Modifier and Type Field Description protected Commandcommandprotected Httphttpprotected Loggerloggerprotected booleanopenprotected DriverOptionsoptionsprotected BooleanspecCompliant-
Fields inherited from interface com.intuit.karate.driver.Driver
METHOD_NAMES
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedWebDriver(DriverOptions options)
-
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, activate, 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
-
http
protected final Http http
-
open
protected boolean open
-
specCompliant
protected Boolean specCompliant
-
logger
protected final Logger logger
-
-
Constructor Detail
-
WebDriver
protected WebDriver(DriverOptions options)
-
-
Method Detail
-
getSessionId
public String getSessionId()
-
getHttp
public Http getHttp()
-
retryIfEnabled
protected <T> T retryIfEnabled(String locator, java.util.function.Supplier<T> action)
-
isJavaScriptError
protected boolean isJavaScriptError(Response res)
-
isLocatorError
protected boolean isLocatorError(Response res)
-
isCookieError
protected boolean isCookieError(Response res)
-
elementIds
public List<String> elementIds(String locator)
- Specified by:
elementIdsin interfaceDriver
-
getOptions
public DriverOptions getOptions()
- Specified by:
getOptionsin interfaceDriver
-
getDimensions
public Map<String,Object> getDimensions()
- Specified by:
getDimensionsin interfaceDriver
-
setDimensions
public void setDimensions(Map<String,Object> map)
- Specified by:
setDimensionsin interfaceDriver
-
fullscreen
public void fullscreen()
- Specified by:
fullscreenin interfaceDriver
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminatedin interfaceDriver
-
isSpecCompliant
public boolean isSpecCompliant()
-
checkForSpecCompliance
public boolean checkForSpecCompliance()
-
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 locator, boolean embed)
- Specified by:
screenshotin interfaceDriver
-
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
-
getDecoder
protected Base64.Decoder getDecoder()
-
-