Custom Search

Wednesday, November 21, 2012

Difference between Mercury DeviceReplay and Sendkeys

The Device Replay feature is used to perform mouse and keyboard actions against screen coordinates 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):

Mercury DeviceReplay is a powerful utility to simulate keyboard input and also for simulating mouse clicks and movements. Under Java Add-in, you can find the DeviceReplay property.

We use SendKeys method to send keyboard input/keystrokes to applications that dont have automation interface. We can also send more than one keystroke at a time using Sendkeys method. To send keystrokes x,y and z, you would send the string argument "xyz".


So, the difference between Mercury DeviceReplay and Sendkeys is

SendKeys -> Support only Keyboard Operations
DeviceReplay-> Support Keyboard + Mouse Operations like Drag Drop too.


In addition to that DeviceReplay supports sending multilingual characters and symbols, while sendkeys support limited keyboard operations.


The other operational difference is dependency on QTP software.

Mercury.DeviceReplay :- It comes with QTP as a module, so you need QTP on the system and only from QTP action you can use it.
SendKeys :- It could be used in VBS script to simulate keyboard inputs with native windows shell commands. It has no dependency on QTP as such.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.