Course Name Start Date Time Duration Registration Link
No Training Programs Scheduled ClickHere to Contact
Please mail To sudhakar@qtpsudhakar.com to Register for any training

Tuesday, March 27, 2012

How to write DP for an object having many objects in its heirarchy?


Suppose I want to do DP for licindia.com where I need to click on the login button. Here the hierarchy captured through Object spy shows as


In this case how should be the DP for clicking on the button?

Beginners will feel difficult when writing descriptive programming.
Here is an example how to write descriptive programming when there are many objects in an object hierarchy.

The basic hierarchy of an object is Browser--> Page --> Object
Some times when you spy on object it shows Browser--> Page -->WebTable--> WebTable-->WebTable-->Object
But in DP you can ignore webtables in the hierarchy and consider Browser--> Page --> Object.
When the hierarchy is like Browser--> Page -->Frame-->WebTable--> WebTable-->WebTable-->Object
Then consider Browser--> Page -->Frame-->Object

A Simple Technique to identify how to write DP when you have confusion in hierarchy level

1.     Add that object to Object Repository 
2.     Identify the hierarchy in OR
3.     Follow the same hierarchy for writing DP


  1. If you're working in the Web Environment, you can totally skip all intermediate objects and only consider the top-most and the bottom-most object and still retrieve the exact same result as you would otherwise. Therefore, saying that:When the hierarchy is like Browser--> Page -->Frame-->WebTable--> WebTable-->WebTable-->ObjectThen consider Browser--> Page -->Frame-->Objectis also equivalent to:Browser--> Page -->Frame-->ObjectBrowser--> Page -->ObjectBrowser--> ObjectHowever, the statement about skipping intermediate objects does not apply to all technologies.

  2. Sudhakar Reddy KakunuriApril 17, 2009 at 10:25 AM

    Yes Anshoo. We can do that.I have given a standard technique to write.