Facebook

For any corporate training requirements Please mail To sudhakar@qtpsudhakar.com
New Schedule in MindQ Systems, Madhapur By SUDHAKAR
Course Name Date Time Duration Type Branch
UFT + UFTPro 20th September 2017 7.30 AM - 9.00 AM IST 25Days Classroom + Online Hitech City
Selenium+Appium 4th October 2017 4.30 PM - 6.00 PM IST 40Days Online -

A book "Cracking the QTP interview" authored by Sudhakar.Read More. Buy From FlipKart

Tuesday, March 27, 2012

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


Question:

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

Browser->frame->webTable->webTable->webTable->webTable->Button

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


Ans:
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

2 comments :

  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.

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

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

    ReplyDelete