Description Object
August 21, 2008
Description Object
Description object is used to create an empty description object in the script. We can add properties and values to the created object.
Using an empty Description object
Set obj=Description. create
Here “obj” is an empty object and contains no properties. This refers any object in application.
Ex:-
Set obj=Description. create
Set objList=Browser(“micclass:=Browser”).Page(“micclass:=Page”).Childobjects( obj)
Msgbox objList.count ‘Gives Total objects count in the page
Using Description object with properties
Set obj=Description. create
obj(“micclass”).value=”Link”
Now “obj“is a link object and it refers all link objects in application.
Ex:-
1)
Set obj=Description. create
obj(“micclass”).value=”Link”
Set objList=Browser(“micclass:=Browser”).Page(“micclass:=Page”).Childobjects( obj)
Msgbox objList.count ‘Gives Total Link objects count in the page
2)
Set obj=Description. create
obj(“micclass”).value=”Link”
obj(“name”).value=”Login”
Set objList=Browser(“micclass:=Browser”).Page(“micclass:=Page”).Childobjects( obj)
Msgbox objList.count ‘Gives only the link which is having “Login” name
Description object is useful when object properties are changing dynamically or if objects are adding in application dynamically and also to handle the duplicate objects (repeated objects).
Entry Filed under: QTP. .
4 Comments Add your own
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed
1.
shreya | September 11, 2008 at 11:00 am
obj(“micclass”).value=”Link” doesnt work in my system Please let me know the reasion & solution.
2.
Rakesh | September 24, 2008 at 10:02 am
please tell me all the steps to use text check point in my script.
3.
Rakesh | September 30, 2008 at 8:59 am
hello,
i m trying to compare 2 images from diff page.
e.g.Toolbar–i m trying to compare available option for an user using Bitmap check point.i captured image, but i can’t able to compare these 2 image.
user1 having some option & user2 having one additional option
please let me know how to compare?
thanks
Rakesh
4.
Rakesh | October 4, 2008 at 1:03 pm
shri,
we are working on webapplication.
our application having one field say first name,and if first name is valid & in database, its all related information will be displayed say Last name,address,City Etc. But when i entered first name thr’ data table field like Last name,address,City Etc. information is not populaing.
But when i entered manually as soon as valid first name i complete all information gets populated.
Developer used on Blur event
please tell me concept to scipt same think
Thanks
Rakesh