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

Deleting cookies


Cookies are actually files containing data that is used by websites to remember user preferences and other relevant information, such as authentication credentials. In some cases, we may need to delete these cookies in order to do the following:

  • Test if a site detects that the cookies are missing

  • Test if a site responds according to the browser's configuration (for example, it prompts for approval, and then stores the selection)

  • Test if a site responds according to the application requirements (for example, prompts for login if an authentication cookie is missing)

There are several ways to achieve deletion of cookies, but here we will show the simplest way with the undocumented WebUtil object and methods.

Getting ready

Let's take an example. From the File menu, navigate to New | Test, use the Ctrl + N shortcut, or use the Web_Functions.vbs library you created in the previous recipe, to encapsulate the commands in your own custom functions.

How to do it...

To delete all cookies,...