What is .Childobjects in QTP?

Child Objects in QTP


What is .Childobjects in QTP?

GUI controls or objects are always located in container objects.Okay lets have a real life example:
Suppose you have kept your laptop on your bedroom,so in this case, your home is your parent object,your laptop is a child object and your bedroom is again a parent object of laptop.Home>>Bedroom>>Laptop
Page[child of browser and parent of text box]
Scenario 1.Between Browser and Page:Browser is a parent object and page is  a child object
ex 1.Find the background color of the page?
Msgbox result  [Please do not try this ,as this will not run,just showing example]
Scenario 2.Between browser,page and checkbox
ex 1.Check(Tick) all the checkboxes present on the page?
Set oDesc=Description.Create()
Set count= Browser(“micclass:=browser”).page(“micclass:=page”).childobject(oDesc)
for i=0 to count-1
Browser(“micclass:=browser”).page(“micclass:=page”).WebCheckBox(count(i)).set “ON”
Hence ,Webedit box is a child object of the Page object, which is in turn is a child object of the Browser object.
Hope it’s is clear as of now…

3 responses to this post.

  1. Posted by geeta on March 23, 2011 at 4:46 am

    Bibek,how can we use descriptive for a drop down box like selecting month,day & year?


    • Geeta,it’s simple:
      Browser(“name:=xyz”).Page(“title:=xyz”).Weblist(“name:=xyz”).select 1 or .select “#1” or .select “Jan” etc.

      let me know if you need more help.


  2. Posted by Anonymous on April 17, 2013 at 7:44 am

    Can u send me a some QTP interview questions for fresher @ naresh.kumar768@gmail.com..Thanx


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: