WORKING WITH QTP

TestEveryThinG

Child Object

Posted by rajivkumarnandvani on February 6, 2009

Getting Child Object:

We can use description object to get all the objects on the page that matches
that specific description. Suppose we have to check all the checkboxes present
on a web page. So we will first create an object description for a
class=SpellE>checkboxe
and then get all the checkboxes from the page

Dim obj_ChkDesc

Set obj_ChkDesc=Description.Create
obj_ChkDesc
class=GramE>(
“html tag”).value = “INPUT”
obj_ChkDesc(“type”).value = “checkbox”
Dim allCheckboxes, singleCheckBox
Set allCheckboxes = Browse(“Browser”).Page(“Page”).
class=SpellE>ChildObjects
(obj_ChkDesc)

For each singleCheckBox in allCheckboxes

singleCheckBox.Set “ON”

Next

The above code will check all the check boxes present on the page. To get all
the child objects we need to specify an object description i.e. we can’t use
the string arguments that will be discussed later in the 2nd way of using the
programming description.

Possible Operation on Description Object

Consider the below code for all the solutions

Dim obj_ChkDesc

Set obj_ChkDesc=Description.Create

obj_ChkDesc
class=GramE>(
“html tag”).value = “INPUT”

obj_ChkDesc(“type”).value = “checkbox”

style=’mso-special-character:line-break’>


Advertisements

One Response to “Child Object”

  1. Cruz said

    Thanks for finally talking about >Child Object WORKING WITH
    QTP <Loved it!

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

 
%d bloggers like this: