Pages

Showing posts with label WebUtil Object. Show all posts
Showing posts with label WebUtil Object. Show all posts

Tuesday, November 13, 2012

Quick Test Professional (QTP) - Utility Objects

QTP provides several utility objects to enhance the power of scripting. Below is a list of all QTP utility objects.

Crypt, DataTable, Description, DTParameter, DTSheet, Environment, Extern, OptionalStep, Parameter, PathFinder, Properties(Collection), QCUtil, Random Number, Recovery, Reporter, Services, Setting, TextUtil, TSLTest, XMLUtil

Only some of the QTP objects are covered here and rest will be covered in other post.


Quick Test Professional (QTP) - WebUtil Object

This provides and undocumented method to delete browser cookies:

'Delete cookies
WebUtil.DeleteCookies

NOTE: The WebUtil object is implicitly available after installing QTP Plus, and it can be explicitly instantiated using the following statement:

'Create the WebUtil object
Set WebUtil = CreateObject("Mercury.GUI_WebUtil")

'Delete cookies and destroy the object
oWebUtil.DeleteCookies
Set oWebUtil = Nothing