watir:键盘指令发送列表
上一篇 /
下一篇 2008-03-13 14:40:05
/ 个人分类:ruby/watir
详细参见:
www.autoitscrīpt.com/autoit3/docs/appendix/SendKeys.htm
在
watir中一般使用ie.send_keys()来模拟键盘操作,如
ie.send_keys("{Enter}")表示发送回车
列出一些常用的:
Send("{TAB}") | Navigate to next control (button, checkbox, etc) |
Send("+{TAB}") | Navigate to previous control. |
Send("^{TAB}") | Navigate to next WindowTab (on a Tabbed dialog window) |
Send("^+{TAB}") | Navigate to previous WindowTab. |
Send("{SPACE}") | Can be used to toggle a checkbox or click a button. |
Send("{+}") | Usually checks a checkbox (if it's a "real" checkbox.) |
Send("{-}") | Usually unchecks a checkbox. |
Send("{NumPadMult}") | Recursively expands folders in a SysTreeView32. |
{ENTER} | ENTER key on the main keyboard |
{ALT} | ALT |
{BACKSPACE} or {BS} | BACKSPACE |
{DELETE} or {DEL} | DELETE |
{UP} | Up arrow |
{DOWN} | Down arrow |
{LEFT} | Left arrow |
{RIGHT} | Right arrow |
{HOME} | HOME |
{END} | END |
{ESCAPE} or {ESC} | ESCAPE |
连续多次发送某个键盘指令,可以使用以下格式:
如:Send("{DEL 4}") 表示模拟连续按4次del键
相关阅读:
- Ruby+Watir经验谈: javascript popup box (51testing, 2007-5-29)
- Ruby+Watir经验谈: 设计RUTF的TestRunner以产生格式化的测试结果 (fishy, 2007-5-30)
- Ruby+Watir经验谈: 漫谈针对功能的自动化测试框架 (lifr, 2007-5-30)
- Ruby+Watir经验谈: 包装Watir::IE (lifr, 2007-6-01)
- watir (iccer, 2007-11-27)
- 如何在 Watir 中识别各种 HTML 对象 (iccer, 2007-11-27)
- Recorder for WATiR (iccer, 2007-11-29)
- watir初学 (qixiafeng, 2007-12-12)
- watir :Tips and Tricks (清水百合, 2008-3-12)
- ruby/watir开发,eclipse环境配置 (清水百合, 2008-3-13)
收藏
举报
TAG:
watir
send_key