通过sendkeys选择QTP-UFT- Weblist - 如何在选择多个值时按住控制键

时间:2016-11-01 17:05:21

标签: vbscript sendkeys hp-uft

Wsh.SendKeys“^”& a(i)未按下控件。像发送值之前和之后的micCtrldown和micctrlup之类的东西会有所帮助但不确定语法

Set Wsh = CreateObject("Wscript.Shell")
a = Split(Datatable.Value("AssignedTerminal", dtlocalsheet),",")
 b = ubound(a)
wait 3
Browser("P&D Routing -Estes").Page("P&D Routing Estes").WebList("addAssignedTerminal_Add").Click
 Setting.WebPackage("ReplayType") = 2
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{DOWN}"
For i = 0 To b
Wsh.SendKeys "^"&a(i)
 Next
 Set WshShell = Nothing
 Setting.WebPackage("ReplayType") = 1

1 个答案:

答案 0 :(得分:0)

我们确定SendKeys函数支持您发送的串联字符串吗?

For i = 0 To b
 Wsh.SendKeys "^"&a(i)
Next

尝试使用预定义的字符串发送到SendKeys,而不是内联构建它。