Package com.intuit.karate.robot
Class RobotBase
- java.lang.Object
-
- com.intuit.karate.robot.RobotBase
-
-
Field Summary
Fields Modifier and Type Field Description booleanautoCloseintautoDelayprotected com.intuit.karate.shell.Commandcommandprotected ElementcurrentWindowprotected booleandebugDimensiondimensionprotected com.intuit.karate.core.ScenarioEngineenginebooleanhighlightinthighlightDurationprotected com.intuit.karate.LoggerloggerMap<String,Object>optionsRobotrobotRegionscreenbooleanscreenshotOnFailureStringtessDataStringtessLangToolkittoolkit-
Fields inherited from interface com.intuit.karate.robot.Robot
METHOD_NAMES
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Elementactivate(String locator)RobotclearFocused()Robotclick()Robotclick(int num)Robotclick(int x, int y)Elementclick(String locator)voiddebugImage(String path)Robotdelay(int millis)voiddisableRetry()RobotdoubleClick()voidenableRetry(Integer count, Integer interval)booleanexists(String locator)Elementfocus(String locator)ElementgetActive()StringgetClipboard()abstract ElementgetFocused()protected intgetHighlightDuration()LocationgetLocation()com.intuit.karate.LoggergetLogger()abstract ElementgetRoot()protected ElementgetSearchRoot()Elementhighlight(String locator)List<Element>highlightAll(String locator)Robotinput(String value)Robotinput(String[] values)Robotinput(String[] values, int delay)Robotinput(String chars, int delay)Elementinput(String locator, String value)protected Elementlocate(int duration, Element searchRoot, String locator)Elementlocate(String locator)protected List<Element>locateAll(int duration, Element searchRoot, String locator)List<Element>locateAll(String locator)List<Element>locateAllImages(Element searchRoot, String path)protected abstract List<Element>locateAllInternal(Element root, String locator)List<Element>locateAllText(Element searchRoot, String path)ElementlocateImage(Region searchRegion, int strictness, byte[] bytes)ElementlocateImage(Region region, String path)protected abstract ElementlocateInternal(Element root, String locator)ElementlocateText(Element searchRoot, String path)Locationlocation(int x, int y)Robotmove(int x, int y)Elementmove(String locator)voidonFailure(com.intuit.karate.core.StepResult stepResult)protected Elementoptional(Element searchRoot, String locator)Elementoptional(String locator)Robotpress()Elementpress(String locator)Regionregion(Map<String,Integer> map)Robotrelease()Elementrelease(String locator)Robotretry()Robotretry(int count)Robotretry(Integer count, Integer interval)<T> Tretry(java.util.function.Supplier<T> action, java.util.function.Predicate<T> condition, String logDescription, boolean failWithException)protected ElementretryForAny(boolean failWithException, Element searchRoot, String... locators)RobotrightClick()byte[]screenshot()byte[]screenshot(int x, int y, int width, int height)byte[]screenshot(Region region)byte[]screenshotActive()Elementselect(String locator)RobotsetActive(Element e)voidsetBasePath(String basePath)voidsetDebug(boolean debug)voidsetHighlight(boolean highlight)voidsetHighlightDuration(int highlightDuration)ElementwaitFor(String locator)ElementwaitForAny(String[] locators)ElementwaitForAny(String locator1, String locator2)ElementwaitForOptional(String locator)ElementwaitForWindowOptional(String locator)protected ElementwaitForWindowOptional(String locator, boolean retry)ObjectwaitUntil(java.util.function.Supplier<Object> condition)protected ObjectwaitUntil(java.util.function.Supplier<Object> condition, boolean failWithException)ObjectwaitUntilOptional(java.util.function.Supplier<Object> condition)Elementwindow(String title)Elementwindow(java.util.function.Predicate<String> condition)booleanwindowExists(String locator)protected abstract ElementwindowInternal(String title)protected abstract ElementwindowInternal(java.util.function.Predicate<String> condition)ElementwindowOptional(String locator)-
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.robot.Robot
getAllWindows, methodNames
-
-
-
-
Field Detail
-
robot
public final Robot robot
-
toolkit
public final Toolkit toolkit
-
dimension
public final Dimension dimension
-
autoClose
public final boolean autoClose
-
screenshotOnFailure
public final boolean screenshotOnFailure
-
autoDelay
public final int autoDelay
-
screen
public final Region screen
-
tessData
public final String tessData
-
tessLang
public final String tessLang
-
command
protected com.intuit.karate.shell.Command command
-
engine
protected com.intuit.karate.core.ScenarioEngine engine
-
logger
protected com.intuit.karate.Logger logger
-
currentWindow
protected Element currentWindow
-
debug
protected boolean debug
-
highlight
public boolean highlight
-
highlightDuration
public int highlightDuration
-
-
Method Detail
-
setDebug
public void setDebug(boolean debug)
-
setHighlight
public void setHighlight(boolean highlight)
-
setHighlightDuration
public void setHighlightDuration(int highlightDuration)
-
disableRetry
public void disableRetry()
-
getLogger
public com.intuit.karate.Logger getLogger()
-
retry
public <T> T retry(java.util.function.Supplier<T> action, java.util.function.Predicate<T> condition, String logDescription, boolean failWithException)
-
setBasePath
public void setBasePath(String basePath)
-
onFailure
public void onFailure(com.intuit.karate.core.StepResult stepResult)
- Specified by:
onFailurein interfacecom.intuit.karate.core.Plugin
-
rightClick
public Robot rightClick()
- Specified by:
rightClickin interfaceRobot
-
doubleClick
public Robot doubleClick()
- Specified by:
doubleClickin interfaceRobot
-
clearFocused
public Robot clearFocused()
-
getHighlightDuration
protected int getHighlightDuration()
-
screenshot
public byte[] screenshot()
- Specified by:
screenshotin interfaceRobot
-
screenshotActive
public byte[] screenshotActive()
- Specified by:
screenshotActivein interfaceRobot
-
screenshot
public byte[] screenshot(int x, int y, int width, int height)
-
screenshot
public byte[] screenshot(Region region)
-
highlightAll
public List<Element> highlightAll(String locator)
- Specified by:
highlightAllin interfaceRobot
-
windowExists
public boolean windowExists(String locator)
- Specified by:
windowExistsin interfaceRobot
-
windowOptional
public Element windowOptional(String locator)
- Specified by:
windowOptionalin interfaceRobot
-
waitForWindowOptional
public Element waitForWindowOptional(String locator)
- Specified by:
waitForWindowOptionalin interfaceRobot
-
getSearchRoot
protected Element getSearchRoot()
-
waitUntilOptional
public Object waitUntilOptional(java.util.function.Supplier<Object> condition)
- Specified by:
waitUntilOptionalin interfaceRobot
-
waitUntil
protected Object waitUntil(java.util.function.Supplier<Object> condition, boolean failWithException)
-
waitForOptional
public Element waitForOptional(String locator)
- Specified by:
waitForOptionalin interfaceRobot
-
waitForAny
public Element waitForAny(String locator1, String locator2)
- Specified by:
waitForAnyin interfaceRobot
-
waitForAny
public Element waitForAny(String[] locators)
- Specified by:
waitForAnyin interfaceRobot
-
retryForAny
protected Element retryForAny(boolean failWithException, Element searchRoot, String... locators)
-
debugImage
public void debugImage(String path)
-
getClipboard
public String getClipboard()
- Specified by:
getClipboardin interfaceRobot
-
getLocation
public Location getLocation()
- Specified by:
getLocationin interfaceRobot
-
location
public Location location(int x, int y)
-
getFocused
public abstract Element getFocused()
- Specified by:
getFocusedin interfaceRobot
-
windowInternal
protected abstract Element windowInternal(java.util.function.Predicate<String> condition)
-
-