hi all ,i would like to know more about child objects,am new for the QTP where it can be used.
Printable View
hi all ,i would like to know more about child objects,am new for the QTP where it can be used.
Any of the object controls like a button, checkbox, radiobutton, combobox, frame etc of the application that can be referred only from its parent object are called child objects.
Eg.
A button may have been placed directly on a window. So, the window will be a parent object and the button will be a child object.
Eg.
A group of radiobuttons may have been placed under a frame and that frame is placed on a window. So, the window will be a parent object of the frame and the frame will be the parent object of the radiobuttons. Radiobuttons will be the child objects.
hi sutnarcha your explanation is very clear ,am having small dought about this concern ,all the objects appeared in the app is created,some times why we need to create child objects for already created objects,can u answer me please?
Hay Rajasekhar... I don't understand what u r trying to ask here... what do u mean 'why we need to create child objects for already created objects'?
[QUOTE=rajasekhar reddy;32355]hi sutnarcha your explanation is very clear ,am having small dought about this concern ,all the objects appeared in the app is created,some times why we need to create child objects for already created objects,can u answer me please?[/QUOTE]
We are not creating any new object.. ChildObjects just assign the child objects to another object...
better u go through QTP profession Help...
[QUOTE=rajasekhar reddy;32355]hi sutnarcha your explanation is very clear ,am having small dought about this concern ,all the objects appeared in the app is created,some times why we need to create child objects for already created objects,can u answer me please?[/QUOTE]
ChildObjects are used in real-time projects where we need to filter specific objects using descriptive programming, since there is a collection and we want to fetch the objects at runtime & get the value pertaining to business requirement.
e.g check that a webtable cell has value 3.
Set OD = Description.Create()
oD("micclass").value = "WebElement"
oD("html id").value = "oClai"
Set ODObject = Browser(b).Page(p).childObjects(OD)
While OD.getroproperty("innertext") <> "4"
if OD.getroproperty("innertext") = "3" then
''Logic on the elment
end loop
end if
Wend