Class DesktopBot

java.lang.Object
dev.botcity.framework.bot.DesktopBot

public class DesktopBot extends Object
Provides a robot interface to operate desktop applications.
Author:
Gabriel Ambrósio Archanjo
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addImage(String label, String path)
    Add image of UI element to be recognized in automation processes.
    void
    addImage(String label, org.marvinproject.framework.image.MarvinImage image)
    Add image of UI element to be recognized in automation processes.
    void
     
    void
    altE(int waitAfter)
     
    void
     
    void
    altF(int waitAfter)
     
    void
     
    void
    altF4(int waitAfter)
     
    void
    altPlusLetter(char c)
     
    void
    altPlusLetter(char c, int waitAfter)
     
    void
     
    void
    altR(int waitAfter)
     
    void
     
    void
    altSpace(int waitAfter)
     
    void
     
    void
    altU(int waitAfter)
     
    void
     
    void
    backspace(int waitAfter)
     
    void
    Invoke the default browser passing a URL
    void
    Click in last found UI element.
    void
    click(int waitAfter)
     
    void
    clickAt(int px, int py)
     
    void
    clickAt(int px, int py, int numClicks)
     
    boolean
    clickOn(String elementId)
     
    boolean
    clickOn(org.marvinproject.framework.image.MarvinImage visualElem)
     
    void
    clickRelative(int x, int y)
    Click relative the last found UI element.
    void
     
    void
    controlA(int waitAfter)
     
    void
     
    void
    controlC(int waitAfter)
     
    void
     
    void
    controlEnd(int waitAfter)
     
    void
     
    void
    controlF(int waitAfter)
     
    void
     
    void
    controlHome(int waitAfter)
     
    void
     
    void
    controlP(int waitAfter)
     
    void
     
    void
    controlR(int waitAfter)
     
    void
     
    void
    controlShiftJ(int waitAfter)
     
    void
     
    void
    controlShiftP(int waitAfter)
     
    void
     
    void
    controlT(int waitAfter)
     
    void
     
    void
    controlU(int waitAfter)
     
    void
     
    void
    controlV(int waitAfter)
     
    void
     
    void
    controlW(int waitAfter)
     
    void
    Copy content to the clipboard
    void
    copyToClipboard(String text, int waitAfter)
    Copy content to the clipboard
    void
     
    void
    delete(int waitAfter)
     
    void
    Double-click in last found UI element.
    void
    doubleClickRelative(int x, int y)
    Double-click relative the last found UI element.
    void
    doubleClickRelative(int x, int y, int sleepBetweenClicks)
    Double-click relative the last found UI element.
    void
     
    void
    Press key "enter"
    void
    enter(int waitAfter)
    Press key "enter"
    void
    exec(String command)
    Command line execution used to run commands or start applications.
    boolean
    find(String elementId, int startX, int startY, int searchWidth, int searchHeight, Double elementMatching, int maxWaitingTime)
     
    boolean
    find(String elementId, Double elementMatching, int maxWaitingTime)
     
    boolean
    find(String elementId, Double elementMatching, int maxWaitingTime, boolean best)
     
    boolean
    find(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, int startX, int startY, int searchWidth, int searchHeight, Double elementMatching, int maxWaitingTime)
     
    boolean
    find(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Double elementMatching, int maxWaitingTime)
     
    boolean
    find(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Double elementMatching, int maxWaitingTime, boolean best)
     
    findAllSubimages(org.marvinproject.framework.image.MarvinImage subimage, org.marvinproject.framework.image.MarvinImage imageIn, int startX, int startY, int searchWindowWidth, int searchWindowHeight, Double similarity)
     
    findAllUntil(String elementId, double elementMatching, int maxWaitingTime)
     
    findAllUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer startX, Integer startY, Integer searchWindowWidth, Integer searchWindowHeight, Integer threshold, Double elementMatching, int maxWaitingTime)
     
    boolean
    findLastUntil(String elementId, int maxWaitingTime)
     
    boolean
    findLastUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, int maxWaitingTime)
     
    boolean
    findLastUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, int maxWaitingTime)
     
    boolean
    findRelative(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, UIElement anchor, int xDiff, int yDiff, int searchWindowWidth, int searchWindowHeight, Integer threshold, Double elementMatching, int maxWaitingTim, boolean best)
     
    org.marvinproject.framework.image.MarvinSegment
    findSubimage(org.marvinproject.framework.image.MarvinImage subimage, org.marvinproject.framework.image.MarvinImage imageIn, int startX, int startY, int searchWindowWidth, int searchWindowHeight, Double similarity, boolean findBest)
     
    org.marvinproject.framework.image.MarvinSegment
    findSubimage(org.marvinproject.framework.image.MarvinImage subimage, org.marvinproject.framework.image.MarvinImage imageIn, int startX, int startY, Double similarity, boolean findBest)
     
    boolean
    findText(String elementId, int maxWaitingTime)
    Find a text element in the UI.
    boolean
    findText(String elementId, int maxWaitingTime, boolean best)
    Find a text element in the UI.
    boolean
    findText(String elementId, Integer threshold, double matching, int maxWaitingTime)
    Find a text element in the UI.
    boolean
    findText(String elementId, Integer threshold, double matching, int maxWaitingTime, boolean best)
    Find a text element in the UI.
    boolean
    findText(String elementId, Integer threshold, int maxWaitingTime)
    Find a text element in the UI.
    boolean
    findText(String elementId, Integer threshold, int maxWaitingTime, boolean best)
    Find a text element in the UI.
    boolean
    findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, int maxWaitingTime)
     
    boolean
    findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, int maxWaitingTime, boolean best)
     
    boolean
    findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, double matching, int maxWaitingTime)
     
    boolean
    findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, double matching, int maxWaitingTime, boolean best)
     
    boolean
    findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, int maxWaitingTime)
     
    boolean
    findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, int maxWaitingTime, boolean best)
     
    boolean
    findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer startX, Integer startY, Integer searchWidth, Integer searchHeight, Integer threshold, int maxWaitingTime, boolean best)
     
    boolean
    findUntil(String elementId, Integer threshold, Double elementMatching, int maxWaitingTime)
     
    boolean
    findUntil(String elementId, Integer threshold, Double elementMatching, int maxWaitingTime, boolean best)
     
    boolean
    findUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, int startX, int startY, int searchWidth, int searchHeight, Integer threshold, Double elementMatching, int maxWaitingTime)
     
    boolean
    findUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, int startX, int startY, Integer threshold, Double elementMatching, int maxWaitingTime)
     
    boolean
    findUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, Double elementMatching, int maxWaitingTime)
     
    boolean
    findUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, Double elementMatching, int maxWaitingTime, boolean best)
     
    boolean
    findUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer startX, Integer startY, Integer searchWindowWidth, Integer searchWindowHeight, Integer threshold, Double elementMatching, int maxWaitingTime, boolean best)
     
    Get the current content in the clipboard.
    double
     
    getCoordinates(String elementImage, int maxWaitingTime, boolean best)
     
    Returns the last recognized UI element.
     
     
     
    org.marvinproject.framework.image.MarvinImage
    Returns the current screen in MarvinImage format.
    void
    Hold key "shift"
    void
    holdShift(int waitAfter)
    Hold key "shift"
    void
    Press key "down"
    void
    keyDown(int waitAfter)
    Press key "down"
    void
     
    void
    keyEnd(int waitAfter)
     
    void
    keyEnter(int waitAfter)
    Press key "enter"
    void
     
    void
    keyEsc(int waitAfter)
     
    void
     
    void
    keyF1(int waitAfter)
     
    void
     
    void
    keyF10(int waitAfter)
     
    void
     
    void
    keyF11(int waitAfter)
     
    void
     
    void
    keyF12(int waitAfter)
     
    void
     
    void
    keyF2(int waitAfter)
     
    void
     
    void
    keyF3(int waitAfter)
     
    void
     
    void
    keyF4(int waitAfter)
     
    void
     
    void
    keyF5(int waitAfter)
     
    void
     
    void
    keyF6(int waitAfter)
     
    void
     
    void
    keyF7(int waitAfter)
     
    void
     
    void
    keyF8(int waitAfter)
     
    void
     
    void
    keyF9(int waitAfter)
     
    void
    Press key "left"
    void
    keyLeft(int waitAfter)
    Press key "left"
    void
    Press key "right"
    void
    keyRight(int waitAfter)
    Press key "right"
    void
    Press key "up"
    void
    keyUp(int waitAfter)
    Press key "up"
    void
     
    void
    keyWindows(int waitAfter)
     
    void
    Shortcut to maximize window on Windows Operating System
    void
    Move cursor to the last found element.
    void
    moveRandom(int rangeX, int rangeY)
     
    void
    moveRelative(int x, int y)
    Move cursor relative the last found UI element.
    void
    moveTo(int x, int y)
    Move cursor to an specific coordinate.
    void
    paste(String text)
    Paste content from the clipboard.
    void
    paste(String text, int waitAfter)
    Paste content from the clipboard.
    void
    print(String text)
     
    void
    Release key "shift".
    void
    Right Click in last found UI element.
    void
    rightClickAt(int x, int y)
     
    void
    rightClickRelative(int x, int y)
     
    void
    Saves a screenshot in a given path
    org.marvinproject.framework.image.MarvinImage
    screenCut(int x, int y, int width, int height)
    Returns a given region of the current screen in MarvinImage format
    void
    scrollDown(int y)
    Scroll down wheel action.
    void
    scrollUp(int y)
    Scroll up wheel action.
    void
    setColorSensibility(double colorSensibility)
     
    void
    Set current UI element.
    void
    Set classloader for loading resources exported in JAR files.
    void
     
    void
    shiftTab(int waitAfter)
     
    void
     
    void
    space(int waitAfter)
     
    void
    startRun(String command)
    Key "Window" + R shortcut to run commands on windws UI.
    void
    tab()
    Press key tab
    void
    tab(int waitAfter)
    Press key "tab"
    void
    Triple-click in last found UI element.
    void
    tripleClickRelative(int x, int y)
    Triple-click relative the last found UI element.
    void
    type(String text)
    Type a text, char by char (inividual key events)
    void
    type(String text, int waitAfter)
    Type text, char by char.
    void
    type(String text, int waitAfterChars, int waitAfter)
    Type text, char by char, specifying key interval time
    void
    typeKeys(Integer... keys)
    Press a sequence of keys.
    void
    typeKeysWithInterval(Integer interval, Integer... keys)
     
    void
    typeWaitAfterChars(String text, int waitAfterChars)
    Type text, char by char, specifying key interval time
    void
    typeWaitAfterChars(String text, int waitAfterChars, int waitAfter)
    Type text, char by char, specifying key interval time
    void
    wait(int ms)
    Wait / Sleep for a given interval.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DesktopBot

      public DesktopBot()
  • Method Details

    • enableDebug

      public void enableDebug()
    • setColorSensibility

      public void setColorSensibility(double colorSensibility)
    • getColorSensibility

      public double getColorSensibility()
    • setResourceClassLoader

      public void setResourceClassLoader(ClassLoader classloader)
      Set classloader for loading resources exported in JAR files.
      Parameters:
      classloader - Classloader to be used.
    • addImage

      public void addImage(String label, String path) throws IOException
      Add image of UI element to be recognized in automation processes. Check method find() and findText() to recognize such elements.
      Parameters:
      label - The image identifier.
      path - The path for the image on disk.
      Throws:
      IOException - if not find the image.
    • addImage

      public void addImage(String label, org.marvinproject.framework.image.MarvinImage image)
      Add image of UI element to be recognized in automation processes. Check method find() and findText() to recognize such elements.
      Parameters:
      label - The image identifier.
      image - The image to be added.
    • getRobot

      public Robot getRobot()
    • getLastElement

      public UIElement getLastElement()
      Returns the last recognized UI element. In other words, the last element found by find() and findText()
      Returns:
      The last recognized UI element.
    • exec

      public void exec(String command) throws IOException
      Command line execution used to run commands or start applications.
      Parameters:
      command - The command to be executed.
      Throws:
      IOException - If an I/O error occurs.
    • browse

      public void browse(String uri) throws IOException
      Invoke the default browser passing a URL
      Parameters:
      uri - The URL to be opened.
      Throws:
      IOException - If an I/O error occurs.
    • clickOn

      public boolean clickOn(String elementId)
    • clickOn

      public boolean clickOn(org.marvinproject.framework.image.MarvinImage visualElem)
    • getLastX

      public Integer getLastX()
    • getLastY

      public Integer getLastY()
    • findText

      public boolean findText(String elementId, int maxWaitingTime, boolean best)
      Find a text element in the UI. Text elements are processed in black and white. Therefore, avoid using this method for texts in colored backgrounds.
      Parameters:
      elementId - element to be found
      maxWaitingTime - maximum time for searching the element on the UI
      best - return the best element? Search in the entire UI. If false, returns the first element that matches the criteria.
      Returns:
      true if the UI element was found, false otherwise
    • findText

      public boolean findText(String elementId, int maxWaitingTime)
      Find a text element in the UI. Text elements are processed in black and white. Therefore, avoid using this method for texts in colored backgrounds.
      Parameters:
      elementId - element to be found
      maxWaitingTime - maximum time for searching the element on the UI
      Returns:
      true if the UI element was found, false otherwise
    • findText

      public boolean findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, int maxWaitingTime, boolean best)
    • findText

      public boolean findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, int maxWaitingTime)
    • findText

      public boolean findText(String elementId, Integer threshold, int maxWaitingTime, boolean best)
      Find a text element in the UI. Text elements are processed in black and white. Therefore, avoid using this method for texts in colored backgrounds.
      Parameters:
      elementId - element to be found
      threshold - grayscale threshold for black and white processing
      maxWaitingTime - maximum time for searching the element on the UI
      best - Search in the entire UI for the best match or returns the first element that matches the criteria.
      Returns:
      true if the UI element was found, false otherwise
    • findText

      public boolean findText(String elementId, Integer threshold, int maxWaitingTime)
      Find a text element in the UI. Text elements are processed in black and white. Therefore, avoid using this method for texts in colored backgrounds.
      Parameters:
      elementId - element to be found
      threshold - grayscale threshold for black and white processing
      maxWaitingTime - maximum time for searching the element on the UI
      Returns:
      true if the UI element was found, false otherwise
    • findText

      public boolean findText(String elementId, Integer threshold, double matching, int maxWaitingTime, boolean best)
      Find a text element in the UI. Text elements are processed in black and white. Therefore, avoid using this method for texts in colored backgrounds.
      Parameters:
      elementId - element to be found
      threshold - grayscale threshold for black and white processing
      matching - minimum score (0.0 to 1.0) to consider a match in the element image recognition process.
      maxWaitingTime - maximum time for searching the element on the UI
      best - Search in the entire UI for the best match or returns the first element that matches the criteria.
      Returns:
      true if the UI element was found, false otherwise
    • findText

      public boolean findText(String elementId, Integer threshold, double matching, int maxWaitingTime)
      Find a text element in the UI. Text elements are processed in black and white. Therefore, avoid using this method for texts in colored backgrounds.
      Parameters:
      elementId - element to be found
      threshold - grayscale threshold for black and white processing
      matching - minimum score (0.0 to 1.0) to consider a match in the element image recognition process.
      maxWaitingTime - maximum time for searching the element on the UI
      Returns:
      true if the UI element was found, false otherwise
    • findText

      public boolean findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, double matching, int maxWaitingTime, boolean best)
    • findText

      public boolean findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, double matching, int maxWaitingTime)
    • findText

      public boolean findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, int maxWaitingTime, boolean best)
    • findText

      public boolean findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer startX, Integer startY, Integer searchWidth, Integer searchHeight, Integer threshold, int maxWaitingTime, boolean best)
    • findText

      public boolean findText(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, int maxWaitingTime)
    • find

      public boolean find(String elementId, Double elementMatching, int maxWaitingTime, boolean best)
    • find

      public boolean find(String elementId, Double elementMatching, int maxWaitingTime)
    • find

      public boolean find(String elementId, int startX, int startY, int searchWidth, int searchHeight, Double elementMatching, int maxWaitingTime)
    • find

      public boolean find(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Double elementMatching, int maxWaitingTime, boolean best)
    • find

      public boolean find(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Double elementMatching, int maxWaitingTime)
    • find

      public boolean find(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, int startX, int startY, int searchWidth, int searchHeight, Double elementMatching, int maxWaitingTime)
    • findUntil

      public boolean findUntil(String elementId, Integer threshold, Double elementMatching, int maxWaitingTime, boolean best)
    • findUntil

      public boolean findUntil(String elementId, Integer threshold, Double elementMatching, int maxWaitingTime)
    • findUntil

      public boolean findUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, Double elementMatching, int maxWaitingTime, boolean best)
    • findUntil

      public boolean findUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, Double elementMatching, int maxWaitingTime)
    • findUntil

      public boolean findUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, int startX, int startY, Integer threshold, Double elementMatching, int maxWaitingTime)
    • findUntil

      public boolean findUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, int startX, int startY, int searchWidth, int searchHeight, Integer threshold, Double elementMatching, int maxWaitingTime)
    • findRelative

      public boolean findRelative(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, UIElement anchor, int xDiff, int yDiff, int searchWindowWidth, int searchWindowHeight, Integer threshold, Double elementMatching, int maxWaitingTim, boolean best)
    • findUntil

      public boolean findUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer startX, Integer startY, Integer searchWindowWidth, Integer searchWindowHeight, Integer threshold, Double elementMatching, int maxWaitingTime, boolean best)
    • getCoordinates

      public Point getCoordinates(String elementImage, int maxWaitingTime, boolean best)
    • findLastUntil

      public boolean findLastUntil(String elementId, int maxWaitingTime)
    • findLastUntil

      public boolean findLastUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, int maxWaitingTime)
    • findLastUntil

      public boolean findLastUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer threshold, int maxWaitingTime)
    • clickAt

      public void clickAt(int px, int py)
    • clickAt

      public void clickAt(int px, int py, int numClicks)
    • rightClickAt

      public void rightClickAt(int x, int y)
    • click

      public void click()
      Click in last found UI element.
    • click

      public void click(int waitAfter)
    • setCurrentElement

      public void setCurrentElement(UIElement el)
      Set current UI element.
      Parameters:
      el - The current element.
    • rightClick

      public void rightClick()
      Right Click in last found UI element.
    • doubleclick

      public void doubleclick()
      Double-click in last found UI element.
    • clickRelative

      public void clickRelative(int x, int y)
      Click relative the last found UI element.
      Parameters:
      x - horizontal offset to the UI element.
      y - vertical offset to the UI element.
    • rightClickRelative

      public void rightClickRelative(int x, int y)
    • doubleClickRelative

      public void doubleClickRelative(int x, int y)
      Double-click relative the last found UI element.
      Parameters:
      x - horizontal offset to the UI element.
      y - vertical offset to the UI element.
    • doubleClickRelative

      public void doubleClickRelative(int x, int y, int sleepBetweenClicks)
      Double-click relative the last found UI element.
      Parameters:
      x - horizontal offset to the UI element.
      y - vertical offset to the UI element.
      sleepBetweenClicks - time in ms between individual click events.
    • tripleClick

      public void tripleClick()
      Triple-click in last found UI element.
    • tripleClickRelative

      public void tripleClickRelative(int x, int y)
      Triple-click relative the last found UI element.
      Parameters:
      x - horizontal offset to the UI element.
      y - vertical offset to the UI element.
    • scrollDown

      public void scrollDown(int y)
      Scroll down wheel action.
      Parameters:
      y - wheel actions.
    • scrollUp

      public void scrollUp(int y)
      Scroll up wheel action.
      Parameters:
      y - wheel actions.
    • move

      public void move()
      Move cursor to the last found element.
    • moveTo

      public void moveTo(int x, int y)
      Move cursor to an specific coordinate.
      Parameters:
      x - coordinate x
      y - coordinate y
    • moveRelative

      public void moveRelative(int x, int y)
      Move cursor relative the last found UI element.
      Parameters:
      x - horizontal offset to the UI Element.
      y - vertical offset to the UI Element.
    • moveRandom

      public void moveRandom(int rangeX, int rangeY)
    • type

      public void type(String text)
      Type a text, char by char (inividual key events)
      Parameters:
      text - text to be typed.
    • typeWaitAfterChars

      public void typeWaitAfterChars(String text, int waitAfterChars)
      Type text, char by char, specifying key interval time
      Parameters:
      text - text to be typed.
      waitAfterChars - time interval between key events.
    • typeWaitAfterChars

      public void typeWaitAfterChars(String text, int waitAfterChars, int waitAfter)
      Type text, char by char, specifying key interval time
      Parameters:
      text - text to be typed.
      waitAfterChars - time interval between key events.
      waitAfter - sleep interval after event.
    • type

      public void type(String text, int waitAfterChars, int waitAfter)
      Type text, char by char, specifying key interval time
      Parameters:
      text - text to be typed.
      waitAfterChars - time interval between key events.
      waitAfter - sleep interval after event.
    • type

      public void type(String text, int waitAfter)
      Type text, char by char.
      Parameters:
      text - text to be typed.
      waitAfter - sleep interval after action.
    • paste

      public void paste(String text)
      Paste content from the clipboard.
      Parameters:
      text - content to be pasted.
    • paste

      public void paste(String text, int waitAfter)
      Paste content from the clipboard.
      Parameters:
      text - content to be pasted.
      waitAfter - sleep interval after action.
    • copyToClipboard

      public void copyToClipboard(String text, int waitAfter)
      Copy content to the clipboard
      Parameters:
      text - content to copy.
      waitAfter - sleep interval after action.
    • copyToClipboard

      public void copyToClipboard(String text)
      Copy content to the clipboard
      Parameters:
      text - content to copy.
    • tab

      public void tab()
      Press key tab
    • tab

      public void tab(int waitAfter)
      Press key "tab"
      Parameters:
      waitAfter - sleep interval after action.
    • keyUp

      public void keyUp(int waitAfter)
      Press key "up"
      Parameters:
      waitAfter - sleep interval after action.
    • keyUp

      public void keyUp()
      Press key "up"
    • keyDown

      public void keyDown(int waitAfter)
      Press key "down"
      Parameters:
      waitAfter - sleep interval after action.
    • keyDown

      public void keyDown()
      Press key "down"
    • keyLeft

      public void keyLeft()
      Press key "left"
    • keyLeft

      public void keyLeft(int waitAfter)
      Press key "left"
      Parameters:
      waitAfter - sleep interval after action.
    • keyRight

      public void keyRight()
      Press key "right"
    • keyRight

      public void keyRight(int waitAfter)
      Press key "right"
      Parameters:
      waitAfter - sleep interval after action.
    • enter

      public void enter()
      Press key "enter"
    • enter

      public void enter(int waitAfter)
      Press key "enter"
      Parameters:
      waitAfter - sleep interval after action.
    • keyEnter

      public void keyEnter(int waitAfter)
      Press key "enter"
      Parameters:
      waitAfter - sleep interval after action.
    • keyEnd

      public void keyEnd()
    • keyEnd

      public void keyEnd(int waitAfter)
    • keyEsc

      public void keyEsc()
    • keyEsc

      public void keyEsc(int waitAfter)
    • keyF1

      public void keyF1()
    • keyF2

      public void keyF2()
    • keyF3

      public void keyF3()
    • keyF4

      public void keyF4()
    • keyF5

      public void keyF5()
    • keyF6

      public void keyF6()
    • keyF7

      public void keyF7()
    • keyF8

      public void keyF8()
    • keyF9

      public void keyF9()
    • keyF10

      public void keyF10()
    • keyF11

      public void keyF11()
    • keyF12

      public void keyF12()
    • keyF1

      public void keyF1(int waitAfter)
    • keyF2

      public void keyF2(int waitAfter)
    • keyF3

      public void keyF3(int waitAfter)
    • keyF4

      public void keyF4(int waitAfter)
    • keyF5

      public void keyF5(int waitAfter)
    • keyF6

      public void keyF6(int waitAfter)
    • keyF7

      public void keyF7(int waitAfter)
    • keyF8

      public void keyF8(int waitAfter)
    • keyF9

      public void keyF9(int waitAfter)
    • keyF10

      public void keyF10(int waitAfter)
    • keyF11

      public void keyF11(int waitAfter)
    • keyF12

      public void keyF12(int waitAfter)
    • holdShift

      public void holdShift()
      Hold key "shift"
    • holdShift

      public void holdShift(int waitAfter)
      Hold key "shift"
      Parameters:
      waitAfter - sleep interval after action.
    • releaseShift

      public void releaseShift()
      Release key "shift". Need to be invoked after holdShift() method or similar.
    • maximizeWindow

      public void maximizeWindow()
      Shortcut to maximize window on Windows Operating System
    • typeKeys

      public void typeKeys(Integer... keys)
      Press a sequence of keys. Hold the keys in the specified order, then release them.
      Parameters:
      keys - array of key identification values like KeyEvent.VK_ENTER
      interval - interval between key presses.
    • typeKeysWithInterval

      public void typeKeysWithInterval(Integer interval, Integer... keys)
    • altPlusLetter

      public void altPlusLetter(char c)
    • altPlusLetter

      public void altPlusLetter(char c, int waitAfter)
    • altE

      public void altE()
    • altE

      public void altE(int waitAfter)
    • altR

      public void altR()
    • altR

      public void altR(int waitAfter)
    • altF

      public void altF()
    • altF

      public void altF(int waitAfter)
    • altU

      public void altU()
    • altU

      public void altU(int waitAfter)
    • altSpace

      public void altSpace()
    • altSpace

      public void altSpace(int waitAfter)
    • altF4

      public void altF4()
    • altF4

      public void altF4(int waitAfter)
    • controlC

      public void controlC()
    • controlC

      public void controlC(int waitAfter)
    • controlV

      public void controlV()
    • controlV

      public void controlV(int waitAfter)
    • controlA

      public void controlA()
    • controlA

      public void controlA(int waitAfter)
    • controlF

      public void controlF()
    • controlF

      public void controlF(int waitAfter)
    • controlP

      public void controlP()
    • controlP

      public void controlP(int waitAfter)
    • controlU

      public void controlU()
    • controlU

      public void controlU(int waitAfter)
    • controlR

      public void controlR()
    • controlR

      public void controlR(int waitAfter)
    • controlT

      public void controlT()
    • controlT

      public void controlT(int waitAfter)
    • controlEnd

      public void controlEnd()
    • controlEnd

      public void controlEnd(int waitAfter)
    • controlHome

      public void controlHome(int waitAfter)
    • controlHome

      public void controlHome()
    • controlW

      public void controlW()
    • controlW

      public void controlW(int waitAfter)
    • controlShiftP

      public void controlShiftP()
    • controlShiftP

      public void controlShiftP(int waitAfter)
    • controlShiftJ

      public void controlShiftJ()
    • controlShiftJ

      public void controlShiftJ(int waitAfter)
    • shiftTab

      public void shiftTab()
    • shiftTab

      public void shiftTab(int waitAfter)
    • getClipboard

      public String getClipboard()
      Get the current content in the clipboard.
      Returns:
      content in the clipboard.
    • keyWindows

      public void keyWindows()
    • keyWindows

      public void keyWindows(int waitAfter)
    • space

      public void space()
    • space

      public void space(int waitAfter)
    • backspace

      public void backspace()
    • backspace

      public void backspace(int waitAfter)
    • delete

      public void delete()
    • delete

      public void delete(int waitAfter)
    • getScreenShot

      public org.marvinproject.framework.image.MarvinImage getScreenShot()
      Returns the current screen in MarvinImage format.
      Returns:
      Image of the current screen in MarvinImage format.
    • screenCut

      public org.marvinproject.framework.image.MarvinImage screenCut(int x, int y, int width, int height)
      Returns a given region of the current screen in MarvinImage format
      Parameters:
      x - region start position x.
      y - region start position y.
      width - region's with.
      height - region's height.
      Returns:
      Image of the current screen in MarvinImage format.
    • saveScreenshot

      public void saveScreenshot(String path)
      Saves a screenshot in a given path
      Parameters:
      path - desired path to save the screenshot.
    • startRun

      public void startRun(String command)
      Key "Window" + R shortcut to run commands on windws UI.
      Parameters:
      command - command to execute.
    • print

      public void print(String text)
    • wait

      public void wait(int ms)
      Wait / Sleep for a given interval.
      Parameters:
      ms - interval in milliseconds.
    • findSubimage

      public org.marvinproject.framework.image.MarvinSegment findSubimage(org.marvinproject.framework.image.MarvinImage subimage, org.marvinproject.framework.image.MarvinImage imageIn, int startX, int startY, Double similarity, boolean findBest)
    • findSubimage

      public org.marvinproject.framework.image.MarvinSegment findSubimage(org.marvinproject.framework.image.MarvinImage subimage, org.marvinproject.framework.image.MarvinImage imageIn, int startX, int startY, int searchWindowWidth, int searchWindowHeight, Double similarity, boolean findBest)
    • findAllUntil

      public List<UIElement> findAllUntil(String elementId, double elementMatching, int maxWaitingTime)
    • findAllUntil

      public List<UIElement> findAllUntil(String elementId, org.marvinproject.framework.image.MarvinImage visualElem, Integer startX, Integer startY, Integer searchWindowWidth, Integer searchWindowHeight, Integer threshold, Double elementMatching, int maxWaitingTime)
    • findAllSubimages

      public List<UIElement> findAllSubimages(org.marvinproject.framework.image.MarvinImage subimage, org.marvinproject.framework.image.MarvinImage imageIn, int startX, int startY, int searchWindowWidth, int searchWindowHeight, Double similarity)