Saturday, September 27, 2008

QTP: Object identify: dynamic, descriptive, etc.

There are 3 ways to identify an object in QTP:

http://sqafront.com/2008/02/12/issueworking-with-dynamic-object-using-quick-test-professional-qtp/

"
Issue:Working with Dynamic Object using Quick Test Professional (QTP)
Issues, Quick Test Pro, Test Automation

There are several ways to work with dynamically generated object:

Using Regular Expression
Using alternative object property to uniquely identify the dynamic object
Descriptive programming
Use regular expressions for the dynamic property.

Open the Object Repository, and find the object from the left side of the Object repository window.
From the list of the properties, select the dynamic property.
Click the edit icon, which is next to the Constant edit field.
Check the ‘Regular expression’ checkbox.
Replace the dynamic portion of the string with wild cards (*) and Click “OK”.
Modify the Object Repository for the dynamic object to use different property to uniquely identify the object:

Open Object repository, and select the dynamic object
Click on the Add/Remove Button
Choose a different property to identify the object uniquely
Use descriptive programming which allows using object properties directly to the script.

Example:

Set BillingOptions = Description.Create

BillingOptions(”title “).Value =”\Billing Options.*”

BillingOptions(”creationtime”).Value =1

SmartTesting @ February 12, 2008

"

No comments:

Digital Inspiration Technology Guide

Change the world with your passion