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
Browser[parent]
Page[child of browser and parent of text box]
Textbox[child]
Similarly,
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?
Result=Browser(“micclass:=browser”).childobject(“bgcolor”)
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()
oDesc.(“micclass”).value=”WebCheckBox”
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”
Next
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…
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?
Posted by Bibek K (AL-09) on April 22, 2011 at 5:09 am
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.
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