RFT中发送键盘按键 - inputChars inputkeys
来源:互联网 发布:网络攻击演示 编辑:程序博客网 时间:2024/06/06 17:35
The article is from: http://blog.csdn.net/testing_is_believing/article/details/5203586
在RFT中,inputChars和inputkeys都可以给指定窗口发送按键。
inputKeys
public void inputKeys(java.lang.String keys)
Sends the supplied characters to the associated window. The window is responsible for sending the characters on to the appropriate controls nested in that window. The characters in the given string are interpreted according to the rules documented under ITopWindow.inputKeys
.
Specified by:
inputKeys
in interface ITopWindow
Parameters:
keys
- the characters to be processed by this window
Since:
RFT1.1
例如,下面脚本将通过发送组合键ALT+H以及A键,控制菜单选择打开计算器的关于界面:
计算器window().click(CAPTION);
计算器window(ANY,MAY_EXIT).inputKeys("%ha");
组合键的标识符包括+^%~(){}:
The characters with special meanings are:
+^%~(){}
The meanings of these special characters are described as follows:
· Tilde is a special character that is shorthand for the ENTER key:
~ Play back an ENTER
~表示回车键
· The following special characters modify the token that follows them:
+ Apply SHIFT to the character that follows immediately +表示SHIFT键
^ Apply CONTROL to the character that follows immediately ^表示CTRL键
% Apply ALT to the character that follows immediately %表示ALT键
For example, the following string plays back "ABCD":
"+a+b+c+d"
· You can use parenthesis to group a set of characters on which the same modifier is applied. For example, the following plays back "ABCD":
"+(abcd)"
可以用()把一组字符括起来,前面的特殊字符对于括起来的一组都生效。
· To play back a character with special meaning (rather than using it for its special meaning), enclose the character in curly braces. For example, the following string plays back "++++":
"{+}{+}{+}{+}"
用花括号对这些特殊字符进行转义。
· You can specify a repeat count by enclosing the character in curly braces, followed by a space and then the count. For example, the following plays back "aaaa":
"{a 4}"
还可以用花括号表示重复指定字符一定的次数。
· To play back only a key-down event for a character, enclose the character in curly braces, followed by a space and then KeyDn. To play back only a key-up event for a character, enclose the character in curly braces, followed by a space and then KeyUp. For example, the following plays back a complete "a" key-press:
"{a KeyDn}{a KeyUp}"
如果要表示按下或释放某个按键,需要在按键后空一个加KeyDn或KeyUp
· Keys without print representation, for example, backspace, escape, print-screen, and so on, are tool-given names. To play back one of these keys, put its name in curly braces. The names are case-insensitive; for example, you can enter either {TAB} or {tab} and get the same result. Some keys have more than one name; for example, {BACKSPACE} and {BKSP} signify the same key. Following is a list of the names for all the unprintable characters. In this list, synonyms are listed next to each other: (下面是各种功能控制键的表示)
{CAPSLOCK} {NUMLOCK} {SCROLLLOCK} {ESCAPE} {ESC} {ENTER} {HELP} {PRTSC} {TAB} {BREAK} {CLEAR} {BACKSPACE} {BS} {BKSP} {DELETE} {DEL} {INSERT} {LEFT} {RIGHT} {UP} {DOWN} {PGUP} {PGDN} {HOME} {END} {F1} {F2} {F3} {F4} {F5} {F6} {F7} {F8} {F9} {F10} {F11} {F12} {F13} {F14} {F15} {F16} {APPS} {Win} {LEFTWIN} {RIGHTWIN} {CTRL} {SHIFT} {ALT} {LEFTCTRL} {LEFTSHIFT} {LEFTALT} {RIGHTCTRL} {RIGHTSHIFT} {RIGHTALT} {ExtDelete} {ExtInsert} {ExtLeft} {ExtRight} {ExtUp} {ExtDown} {ExtPgUp} {ExtPgDn} {ExtHome} {ExtEnd} {NumDelete} {NumInsert} {NumLeft} {NumRight} {NumUp} {NumDown} {NumPgUp} {NumPgDn} {NumHome} {NumEnd} {Num} {Num-} {Num/} {Num+} {Num~} {NumEnter} {Num0} {Num1} {Num2} {Num3} {Num4} {Num5} {Num6} {Num7} {Num8} {Num9} {Num.} >
Example:
Send "AB" to a password text field in classicJava application
passwordText().inputKeys("+a+b");
inputChars
与inputKeys相反,inputChars发送的按键字符不会被解释。
public void inputChars(java.lang.String keys)
Sends the supplied characters to the associated window. The window is responsible for sending the characters on to the appropriate controls nested in that window. The characters are uninterpreted. For example, inputChars("+a+b") emits "+a+b", in contrast to inputKeys("+a+b"), which interprets the "+" as a shift and emits "AB".
Specified by:
inputChars
in interface ITopWindow
Parameters:
keys
- The characters to be processed by this window
Since:
RFT1.1
- RFT中发送键盘按键 - inputChars inputkeys
- 在RFT中发送键盘按键 - inputChars vs. inputkeys
- QT4 键盘按键发送自定义信号
- c# sendmessage 发送键盘按键详解
- WinForm中接收键盘按键
- jquery中获取键盘按键
- jquery中获取键盘按键
- jquery中获取键盘按键
- 中英键盘按键说明
- WPA 向已有程序发送虚拟键盘按键
- [转]利用winapi向其它进程发送键盘按键消息
- android 模拟键盘事件/android发送虚拟按键
- 利用虚拟键盘驱动uinput向系统发送按键指令
- 向指定窗口发送模拟键盘按键消息
- 驱动中实现模拟键盘按键
- 如何在对话框中响应键盘按键
- 驱动中实现模拟键盘按键
- 驱动中实现模拟键盘按键
- C#学习之列表
- 谷歌-SEO
- windows系统下openssl的编译
- ubuntu 13.1o 使用root帐号登录X
- 基于插件开发的Android实现流程
- RFT中发送键盘按键 - inputChars inputkeys
- 几种局部刷新技术
- struts2 入门
- 61. Rotate List
- angularJs中datatable实现
- poj1012的失误
- hdu 1301 Jungle Roads &&poj 1251 (prim 或者kruskal)
- HDU 1331 Function Run Fun
- PHP的注释