Automation Question:
Download Job Interview Questions and Answers PDF
Tell us what methods of Robot Class do you know?
Answer:
Some commonly and popularly used methods of Robot Class during web automation:
keyPress(): method with press down arrow key of Keyboard
Example:
keyPress(KeyEvent.VK_DOWN)
keyRelease(): method with release down arrow key of Keyboard:
Example:
robot.keyRelease(KeyEvent.VK_DOWN)
mouseRelease() method will release the right click of your mouse
Example:
mouseRelease(InputEvent.BUTTON3_DOWN_MASK)
mouseMove() method will move mouse pointer to the specified X and Y coordinates.
Example:
robot.mouseMove(point.getX(), point.getY())
mousePress() method will press the right click of your mouse.
Example :
robot.mousePress(InputEvent.BUTTON3_DOWN_MASK)
keyPress(): method with press down arrow key of Keyboard
Example:
keyPress(KeyEvent.VK_DOWN)
keyRelease(): method with release down arrow key of Keyboard:
Example:
robot.keyRelease(KeyEvent.VK_DOWN)
mouseRelease() method will release the right click of your mouse
Example:
mouseRelease(InputEvent.BUTTON3_DOWN_MASK)
mouseMove() method will move mouse pointer to the specified X and Y coordinates.
Example:
robot.mouseMove(point.getX(), point.getY())
mousePress() method will press the right click of your mouse.
Example :
robot.mousePress(InputEvent.BUTTON3_DOWN_MASK)
Download Automation Interview Questions And Answers
PDF
Previous Question | Next Question |
Do you know how to locate a link using its text in Selenium? | Tell us how to login into any site if it’s showing any authentication pop-up for username and password? |