文档库 最新最全的文档下载
当前位置:文档库 › AutoTest

AutoTest

Const MSG_BOARD_ASSERT = 255
BSObject.RegExitMsg MSG_BOARD_ASSERT
PressKeyInterval=700 '// 按键间隔。毫秒级。

While(1)

BSObject.SendKeyCode 1 , PressKeyInterval
BSObject.SendKeyCode 2 , PressKeyInterval
BSObject.SendKeyCode 4 , PressKeyInterval
BSObject.SendKeyCode 5 , PressKeyInterval
BSObject.SendKeyCode 6 , PressKeyInterval
BSObject.SendKeyCode 7 , PressKeyInterval
BSObject.SendKeyCode 8 , PressKeyInterval
BSObject.SendKeyCode 9 , PressKeyInterval
BSObject.SendKeyCode 10, PressKeyInterval
BSObject.SendKeyCode 11, PressKeyInterval
BSObject.SendKeyCode 13, PressKeyInterval
BSObject.SendKeyCode 14, PressKeyInterval
BSObject.SendKeyCode 48, PressKeyInterval
BSObject.SendKeyCode 49, PressKeyInterval
BSObject.SendKeyCode 50, PressKeyInterval
BSObject.SendKeyCode 51, PressKeyInterval
BSObject.SendKeyCode 52, PressKeyInterval
BSObject.SendKeyCode 53, PressKeyInterval
BSObject.SendKeyCode 54, PressKeyInterval
BSObject.SendKeyCode 55, PressKeyInterval
BSObject.SendKeyCode 56, PressKeyInterval
BSObject.SendKeyCode 57, PressKeyInterval
BSObject.SendKeyCode 42, PressKeyInterval
BSObject.SendKeyCode 35, PressKeyInterval

'为了清晰起见,也可使用下面的语句。
Press("POWER")
Press("0")
Press("1")
Press("2")
Press("3")
Press("4")
Press("5")
Press("6")
Press("7")
Press("8")
Press("9")
Press("*")
Press("#")
Press("UP")
Press("DOWN")
Press("LEFT")
Press("RIGHT")
Press("CALL")
Press("CANCEL")
Press("POWER")
Press("EXT1")
Press("EXT2")
Press("EXT3")
Press("EXT4")
Press("EXT5")

Wend

Function Press(C_KEY)
BSObject.PressKey C_KEY, PressKeyInterval
BSObject.Trace ("PressKey " & C_KEY)
End Function

Function SleepFunction(S_times)
BSObject.sleep 1000*(S_times)
End Function

Function TraceFunction(text)
BSObject.Trace (text)
End Function

Function Sleep(S_times)
BSObject.sleep 1000*(S_times)
End Function


' ------------------------
' KEY MAP
' ------------------------
' "0" // 0
' "1" // 1
' "2" // 2
' "3" // 3
' "4" // 4
' "5" // 5
' "6" // 6
' "7" // 7
' "8" // 8
' "9" // 9
' "#" // HASH
' "*" // STAR
'
' "UP" // UP
' "DOWN" // DOWN
' "LEFT" // LEFT
' "RIGHT" // RIGHT
' "CALL" // Call 绿键
' "POWER" // END 红键
'
' "EXT1" // LEFTSOFK 左软键
' "EXT2" // RIGHTSOFK 右软键
' "EXT3" // Ring Volume 侧键上
' "EXT4" // Ring Volume 侧键下
' "EXT5" // OK

'
'BSObject.SendKeyCode 13, PressKeyInterval ‘按ok键
'
'Log Trace Out 实际按键 十进制数
'KPD_SVR: Virtual Key: 0x1 is DOWN 绿键 1
'KPD_SVR: Virtual Key: 0x2 is DOWN 红键 2
'KPD_SVR: Vi

rtual Key: 0x4 is DOWN 方向上键 4
'KPD_SVR: Virtual Key: 0x5 is DOWN 方向下键 5
'KPD_SVR: Virtual Key: 0x6 is DOWN 方向左键 6
'KPD_SVR: Virtual Key: 0x7 is DOWN 方向右键 7
'KPD_SVR: Virtual Key: 0x8 is DOWN 左软键 8
'KPD_SVR: Virtual Key: 0x9 is DOWN 右软键 9
'KPD_SVR: Virtual Key: 0xa is DOWN 上侧键 10
'KPD_SVR: Virtual Key: 0xb is DOWN 下侧键 11
'KPD_SVR: Virtual Key: 0xd is DOWN ok 13
'KPD_SVR: Virtual Key: 0xe is DOWN 拍照侧键 14
'KPD_SVR: Virtual Key: 0x30 is DOWN 0 48
'KPD_SVR: Virtual Key: 0x31 is DOWN 1 49
'KPD_SVR: Virtual Key: 0x32 is DOWN 2 50
'KPD_SVR: Virtual Key: 0x33 is DOWN 3 51
'KPD_SVR: Virtual Key: 0x34 is DOWN 4 52
'KPD_SVR: Virtual Key: 0x35 is DOWN 5 53
'KPD_SVR: Virtual Key: 0x36 is DOWN 6 54
'KPD_SVR: Virtual Key: 0x37 is DOWN 7 55
'KPD_SVR: Virtual Key: 0x38 is DOWN 8 56
'KPD_SVR: Virtual Key: 0x39 is DOWN 9 57
'KPD_SVR: Virtual Key: 0x2a is DOWN * 42
'KPD_SVR: Virtual Key: 0x23 is DOWN # 35
'
'注意:1.支持常用vbscript语法。
' 2.不能实现长按键。
' 3.只在手机在非sleep状态才响应按键消息。手机背光灯最好设置为常亮。
' 4.按键间隔不宜过小。














































相关文档