Class RobotEngine


  • public class RobotEngine
    extends AbstractEngine
    Engine able to send keyboard and mouse system commands using Java Robot
    • Constructor Detail

      • RobotEngine

        public RobotEngine​(RobotDriver robotDriver)
    • Method Detail

      • clickAt

        public void clickAt​(int x,
                            int y)
        Move the mouse at (X,Y) screen position and then click the mouse button 1
        Parameters:
        x - the X coordinate
        y - the Y coordinate
      • type

        public void type​(String text)
        Type some text
        Parameters:
        text - the text to type
      • type

        public void type​(int... keyCodes)
        Type some keys defined in java.awt.event.KeyEvent
        Parameters:
        keyCodes - the special key codes
      • type

        public void type​(String text,
                         int... keyCodes)
        Type some text but combine them with some keys defined in java.awt.event.KeyEvent
        It first presses the special key codes(for example Alt + Shift), then it types the provided text and then it releases the special keys in reversed order(for example Shift + Alt )
        Parameters:
        text - the text to type
        keyCodes - the special key codes
      • typeTab

        public void typeTab()
        TAB once
      • typeTab

        public void typeTab​(int numberOfTabs)
        TAB a number of times
        Parameters:
        numberOfTabs - how many tabs
      • typeEnter

        public void typeEnter()
        Type the ENTER key
      • pressEsc

        public void pressEsc()
        Press the Escape key
      • pressAltF4

        public void pressAltF4()
        Press Alt + F4 keys
      • typeSpace

        public void typeSpace()
        Type the SPACE key
      • keyPress

        public void keyPress​(int keyCode)
        Presses a given key. The key should be released using the keyRelease method.
        Parameters:
        keyCode - Key to press (e.g. KeyEvent.VK_A)
      • keyRelease

        public void keyRelease​(int keyCode)
        Releases a given key.
        Parameters:
        keyCode - Key to release (e.g. KeyEvent.VK_A)