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

Writing a key to the Windows® system registry


The purpose of writing registry keys and values is so that they can be used within automated tests. The reason is that, in general, automation should refrain from making changes to the operating system, and this includes the registry. This is necessary to keep our automated tests as less invasive as possible. However, it is important to know how this can be accomplished.

To write a value to a custom registry key that passes UFT data gathered by a process running in parallel to the automated test, UFT uses the RegRead method at the appropriate time to retrieve the data. This allows, in parallel, the asynchronous usage of the testing tool and external executables.

In this recipe, we will see how to write a custom key to the registry.

Getting ready

From the File menu, navigate to New | Test, or use the Ctrl + N shortcut. You can use the same test as in the previous recipe.

How to do it...

The syntax to write the value of a registry key is as follows:

object...