Quick Test Professional

How to use Device Replay Method

Posted on: March 29, 2010


The Device Replay feature is used to perform mouse and keyboard actions against screen coordnates that are provided. The Device Replay functions are not automatically recorded, but must be programmed manually in the Expert View.

1. Create the Device Replay Object.

Example:
Set DeviceReplay = CreateObject(“Mercury.DeviceReplay”)

2. Call the desired Device Replay function.

Example:
DeviceReplay.SendString(“Hello, World”)

3. When done with the Device Replay object, release it.

Example:
Set DeviceReplay = Nothing

The functions that can be used with the Device Replay object are (all coodinates are relative to the top left corner of the screen):

Function Description
MouseMove x, y Move the mouse to the screen coordinate (x,y).
MouseClick x, y, button Move the mouse to the screen coordinate (x,y) and click the button
(0=left; 1=middle; 2=right).
MouseDblClick x, y, button Move the mouse to the screen coordinate (x,y) and double-click the button
(0=left; 1=middle; 2=right).
DragAndDrop x, y, dropx, dropy, button Drag the mouse from screen coordinate (x,y) to (dropx,dropy) with the button
(0=left; 1=middle; 2=right) pressed.
PressKey key Press a key using the ASCII code of the key.
For example, Chr(13), vbCR and vbTab.
MouseDown x, y, button Press the mouse button on screen coordinate (x,y).
MouseUp x, y, button Release the mouse button on screen coordinate (x,y).
KeyDown key Press a key using the ASCII code of the key.
For example, Chr(13), vbCR and vbTab.
KeyUp key Release a key using the ASCII code of the key.
For example, Chr(13), vbCR and vbTab.
SendString string Type a string.
About these ads

2 Responses to "How to use Device Replay Method"

Thanks so much, very useful.

How to refresh the Web Frame using Mouse Right Click button in qtp

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 12 other followers

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: