Simulate TAB keypress event in Selenium RC

前端 未结 5 1095
滥情空心
滥情空心 2021-02-07 08:10

I need to simulate a tab keypress in Selenium RC, using the Java API.

I do this after having entered some text using:

selenium.type(input, \"mytext\");
<         


        
5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-07 09:11

    Improvising Ryley's answer, we can use

    selenium.keyDownNative(java.awt.event.KeyEvent.VK_TAB + "");
    selenium.keyUpNative(java.awt.event.KeyEvent.VK_TAB + "");
    

    I tried this method for VK_CONTROL in IE and it worked good.

提交回复
热议问题