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.
相关阅读:
- Ajax搜索框模拟键盘输入 (xcheng118, 2015-4-17)
- 使用系统计算器计算输入算式 (mengdi007, 2015-5-15)
- QTP SetTOProperty用法 (mengdi007, 2015-5-27)
- DOM在QTP上的应用 (200859060102, 2015-6-05)
- 使用QTP调用psql.exe操作postgresql (Eyuang, 2015-6-05)
- 【转】Selenium WebDriver中一些鼠标和键盘事件的使用 (yanfang_zheng, 2015-6-28)
- 参数化之Excel来源 (tievoli, 2015-7-20)
- QTP加载函数库的3种方式 (tievoli, 2015-7-22)
- QTP用编程的方式创建检查点 (zaza9084, 2015-10-19)
- QTP模拟键盘输入ALT+F4 (cjh125527843, 2015-9-15)
收藏
举报
TAG:
QTP
WebEdit
键盘