Click here to Skip to main content
15,886,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We are using selenium-java for automation and I am facing an issue with robot keys in VM. When I am executing code with a connection to VM open, robot keys are working fine. But if I kick-start the execution and close the VM connection, it is failing.

What I have tried:

I am using below code:

Robot robot = new Robot();
robot.delay(250);
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.delay(100);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900