java+selenium 键盘操作

WebElement element = driver.findElement(By.id("kw"));
element.sendKeys("软件自动化测试");//输入文本
# Keys.BACK_SPACE:回退键(BackSpace)
25 # Keys.TAB:制表键(Tab)
26 # Keys.ENTER:回车键(Enter)
27 # Keys.SHIFT:大小写转换键(Shift)
28 # Keys.CONTROL:Control键(Ctrl)
29 # Keys.ALT:ALT键(Alt)
30 # Keys.ESCAPE:返回键(Esc)
31 # Keys.SPACE:空格键(Space)
32 # Keys.PAGE_UP:翻页键上(Page Up)
33 # Keys.PAGE_DOWN:翻页键下(Page Down)
34 # Keys.END:行尾键(End)
35 # Keys.HOME:行首键(Home)
36 # Keys.LEFT:方向键左(Left)
37 # Keys.UP:方向键上(Up)
38 # Keys.RIGHT:方向键右(Right)
39 # Keys.DOWN:方向键下(Down)
40 # Keys.INSERT:插入键(Insert)
41 # DELETE:删除键(Delete)
42 # NUMPAD0 ~ NUMPAD9:数字键1-9
43 # F1 ~ F12:F1 - F12键
44 # (Keys.CONTROL, ‘a’):组合键Control+a,全选
45 # (Keys.CONTROL, ‘c’):组合键Control+c,复制
46 # (Keys.CONTROL, ‘x’):组合键Control+x,剪切
47 # (Keys.CONTROL, ‘v’):组合键Control+v,粘贴

猜你喜欢

转载自blog.csdn.net/qq_38296051/article/details/121931714