Book Image

Advanced UFT 12 for Test Engineers Cookbook

Book Image

Advanced UFT 12 for Test Engineers Cookbook

Overview of this book

Table of Contents (18 chapters)
Advanced UFT 12 for Test Engineers Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Customizing mouse operations (DeviceReplay)


The DeviceReplay object enables us to perform mouse and keyboard operations using code, for instance MouseMove, MouseClick, PressKey, SendString, and DragAndDrop. Though in past years it was not so well documented in HP's materials, now, thanks to the work of some very dedicated people from the QTP (UFT) community, light has been shed upon the workings of this object.

The DeviceReplay object is very important for automation, one reason being that the common Test Object methods that UFT provides, such as Click, do not always perform well. For example, quite often, one can encounter objects that do not respond to an onclick event unless the mouse is actually moved to a location within its bounding rectangle. In such a case, we may revert to the DeviceReplay object to override the Click method and perform the MouseMove operation before sending a MouseClick event.

This recipe describes how to use the DeviceReplay object to override the Click method and...