Thursday, June 4, 2009

How to use Description Object?

Used to create a Properties collection object.
Creates a new, empty description object in which you can add collection of properties and values in order to specify the description object in place of a test object name in a step.


For example, the statements below instruct QuickTest to enter the text: MyName in the first WebEdit object in the Mercury Tours page with the name UserName


Set EditDesc = Description.Create()
EditDesc("Name").Value = "userName"
EditDesc("Index").Value = "0"
Browser("Welcome: Mercury").Page("Welcome: Mercury").WebEdit(EditDesc).Set "MyName"
When working with Properties objects, you can use variable names for the properties or values to generate the object description based on properties or values you retrieve during a run session. You can also create several Properties objects in your test if you want to use programmatic descriptions for several objects.

'Returns the number of Property objects in the Properties collection
PropCount = MyDesc.Count

ex2:
Dim obj_Desc
Set obj_Desc = Description.Create
obj_Desc("name").value = "q"
obj_Desc("class name").value = "web edit"
browser("Google").Page("Google").WebEdit(obj_Desc).Set "hi"

No comments:

Post a Comment