标签:robotframewrok paramiko control character sshlibrary via ssh
How to write CTRL-C and send it to remoter ssh server via ssh library in robot framework
实现 ctlr+c按键同时按下的效果,并把这个按键动作发送到远端ssh server 服务器;
robot表格式语言代码如下ctlr+c ^c:
${crtl_c} Evaluatechr(int(3))
SSHLibrary.Write Bare ${crtl_c}
因为是^C的ascii码是3,chr(int(3)) 把整型的3转换成asc的字符型,然后发送这个控制字符给远程终端;
同理^E
robot表格式语言代码如下ctlr+e ^e
${crtl_e} Evaluatechr(int(5))
SSHLibrary.Write Bare ${crtl_e}
Seq
|
十六进
|
缩写
|
字符名
|
|
---|---|---|---|---|
00
|
0x00
|
NUL
|
Null (空)
|
|
^A
|
01
|
0x01
|
SOH
|
Start of Heading (报头开始)
|
^B
|
02
|
0x02
|
STX
|
Start of Text (正文开始)
|
^C
|
03
|
0x03
|
ETX
|
End of Text (正文结束)
|
^D
|
04
|
0x04
|
EOT
|
End of Transmission (传输结束)
|
^E
|
05
|
0x05
|
ENQ
|
Enquiry (查询)
|
^F
|
06
|
0x06
|
ACK
|
Acknowledge (确认)
|
^G
|
07
|
0x07
|
BEL
|
Bell (振铃)
|
^H
|
08
|
0x08
|
BS
|
Backspace (退格)
|
^I
|
09
|
0x09
|
HT
|
Horizontal Tab (水平制表)
|
^J
|
10
|
0x0A
|
LF
|
Line Feed (馈行)
|
^K
|
11
|
0x0B
|
VT
|
Vertical Tab (垂直制表)
|
^L
|
12
|
0x0C
|
FF
|
Form Feed (馈页)
|
^M
|
13
|
0x0D
|
CR
|
Carriage Return (回车)
|
^N
|
14
|
0x0E
|
SO
|
Shift Out (移出)
|
^O
|
15
|
0x0F
|
SI
|
Shift In (移入)
|
^P
|
16
|
0x10
|
DLE
|
Data Link Escape (数据链路转义)
|
^Q
|
17
|
0x11
|
DC1
|
Device Control 1 (设备控制1)
|
^R
|
18
|
0x12
|
DC2
|
Device Control 2 (设备控制2)
|
^S
|
19
|
0x13
|
DC3
|
Device Control 3 (设备控制3)
|
^T
|
20
|
0x14
|
DC4
|
Device Control 4 (设备控制4)
|
^U
|
21
|
0x15
|
NAK
|
Negative Acknowledge (否认)
|
^V
|
22
|
0x16
|
SYN
|
Synchronous Idle (同步空闲)
|
^W
|
23
|
0x17
|
ETB
|
End of Transmission Block (传输块结束)
|
^X
|
24
|
0x18
|
CAN
|
Cancel (取消)
|
^Y
|
25
|
0x19
|
EM
|
End of Medium (介质结束)
|
^Z
|
26
|
0x1A
|
SUB
|
Substitute (替换)
|
^[
|
27
|
0x1B
|
ESC
|
Escape (转义)
|
^\
|
28
|
0x1C
|
FS
|
File Separator (文件分隔符)
|
^]
|
29
|
0x1D
|
GS
|
Group Separator (分组符)
|
^^
|
30
|
0x1E
|
RS
|
Record Separator (记录分隔符)
|
^_
|
31
|
0x1F
|
US
|
Unit Separator (单元分隔符)
|
127
|
0x7F
|
DEL
|
Delete (删除)
|
ref:
https://groups.google.com/forum/#!topic/robotframework-users/UmqviNbrYO4
robot framework用SSHLibrary发送ctrl-c 等控制字符(control character)到远端 ssh server(linux server etc的表格代码
标签:robotframewrok paramiko control character sshlibrary via ssh
原文地址:http://blog.csdn.net/youcharming/article/details/44196275