Other ways to turn on or off the caps lock

Turn on/off the Caps lock with Selenium RC and key press and key up:

selenium.keyUpNative(KeyEvent.VK_CAPS_LOCK.toString()); // Turn off the caps Lock, you can use this if ou don’t know if the caps lock is on or off. So you can turn off before you press the key.

selenium.keyPressNative(KeyEvent.VK_CAPS_LOCK.toString()); // Turn on the caps lock

With the Robot:

Robot robo = new Robot();

Very easy, and if one way doesn`t work, you can try another 🙂

Bye bye !