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 ...

Get Advanced UFT 12 for Test Engineers Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.