selenium-webdriver Robot In Selenium


  • delay(int ms)
  • keyPress(int keycode)
  • keyRelease(int keycode)
  • mouseMove(int x, int y)
  • mousePress(int buttons)
  • mouseRelease(int buttons)
  • mouseWheel(int wheelAmt)


msTime to sleep in milliseconds
keycodeConstant to press the specified key for example to press A code is VK_A. Please refer for more details :
x,yScreen coordintates
buttonsThe Button mask; a combination of one or more mouse button masks
wheelAmtNumber of notches to move mouse wheel, negative value to move up/away from user positive value to move down/towards user


This section contains details about implementation of Robot API with Selenium Webdriver. The Robot class is used to generate native system input when selenium is not capable to do that for example pressing right key of mouse, pressing F1 key etc.