Hi all,
Here is the simple way to pass any KeyBoard keys to selenium. You can use below methods for your required purpose.
sel.keyDownNative(java.awt.event.KeyEvent.VK_SHIFT + ""); //To keep pressing a key
sel.keyPressNative(java.awt.event.KeyEvent.VK_F1 + ""); //To just type a key
sel.keyUpNative(java.awt.event.KeyEvent.VK_SHIFT + ""); //To Release a key being in pressed state
For WebDriver instance, just pass using
driver.sendKeys()
Comments
Post a Comment