WebEdit回车操作

上一篇 / 下一篇  2014-01-28 16:09:12 / 个人分类:QTP

业务场景
输入货号后,回车选择单件

实现思路

1.set货号
2.光标focus,设置为鼠标回放模式
3.SendKeys回车键
4.修改回事件回放模式


脚本编写:
Browser("").Page("").Frame("").WebEdit("").Set ""
Setting.WebPackage("ReplayType") = 2
Browser("").Page("").Frame("").WebEdit("").Object.focus
Dim WshObj
Set WshObj=CreateObject("WScript.Shell")
WshObj.SendKeys "{ENTER}"
Set WshObj = nothing 
Setting.WebPackage("ReplayType") = 1

  
Tips:什么是ReplayType?

ReplayType is QTP Web Add-in setting. It can be used to change how the events are replayed on the browser. There are two modes of ReplayType:
    Events (1) - Replay of events using the Browser methods (something similar to DOM).[default]
    Mouse (2) - Replay of events using the mouse and keyboard simulation.


TAG: QTP WebEdit 键盘

 

评分:0

我来说两句

Open Toolbar