English 中文(简体)
Record enter button in qtp
原标题:
  • 时间:2010-01-07 06:36:19
  •  标签:
  • qtp

How to record ENTER button that we use through the keyboard in QTP for applications

最佳回答

I assume you want to replay an Enter key, in most cases when QTP does not record an action it s much better to add the step manually than trying to force QTP to record it.

If the test object in question supports Type you can use that:

Window("Calc").Type micReturn

Otherwise you can use the DeviceReplay object as described in this article

Set dr = CreateObject("Mercury.DeviceReplay")
dr.PressKey 28   28 = Return (Enter)
问题回答

Another option to replay an Enter button press would be to simply use the SendKeys Method of the Windows Script Host object. The code would look something like this:

Dim WshShell
Set WshShell = CreateObject("WShell.script")
WshShell.SendKeys "{ENTER}"
Set WshShell = Nothing




相关问题
QTP - testing while browser/page title changes

I am trying to make simple testing but failed because I have no clue how to handle with browser title that changes during the testing. Simple example: Google>Find "blabol" Once its done, the browser ...

QTP - 取得要素价值

我从QTP开始,仅仅找不到如何获得要素的价值。 例如,当我只想比较一下从山洞中发现的成果数量时。 我试图用物体选择这个要素......

Record enter button in qtp

How to record ENTER button that we use through the keyboard in QTP for applications

How do you write your QTP Tests?

I am experimenting with using QTP for some webapp ui automation testing and I was wondering how people usually write their QTP tests. Do you use the object map, descriptive programming, a combination ...

Dynamically building a URL in QTP

I ve been taking a quick look at QTP with one of our test team. We ve figured out some basics like recording a test, capturing text using output values, putting in check points, etc. However, I can ...

热门标签