|
做什么的??
不知道,看看手册
Retrieving and Setting Test Object Property Values
Test object properties are the set of properties defined by QuickTest for each object. You can set and retrieve a test object's property values, and you can retrieve the values of test object properties from a run-time object.
When you run your test, QuickTest creates a temporary version of the test object that is stored in the test object repository. You use the GetTOProperty, GetTOProperties, and SetTOProperty methods to set and retrieve the test object property values of the test object.
The GetTOProperty and GetTOProperties methods enable you to retrieve a specific property value or all the properties and values that QuickTest uses to identify an object.
The SetTOProperty method enables you to modify a property value that QuickTest uses to identify an object.
Note: Because QuickTest refers to the temporary version of the test object during the test run, any changes you make using the SetTOProperty method apply only during the course of the test run, and do not affect the values stored in the test object repository.
For example, the following statements would set the Submit button's name value to my button, and then retrieve the value my button to the ButtonName variable:
Browser("QA Home Page").Page("QA Home Page").WebButton("Submit").SetTOProperty "Name", "my button"
ButtonName=Browser("QA Home Page").Page("QA Home Page").WebButton("Submit").GetTOProperty("Name")
You use the GetROProperty method to retrieve the current value of a test object property from a run-time object in your application.
For example, you can retrieve the target value of a link during the test run as follows:
link_href = Browser("Mercury Technologies").Page("Mercury Technologies").Link("Jobs").GetROProperty("href")
Tip: If you do not know the test object properties of objects in your Web site or application, you can view them using the Object Spy. For information on the Object Spy, see Understanding the Test Object Model.
For a list and description of test object properties supported by each object, and for additional information about the GetROProperty, GetTOProperty, GetTOProperties, and SetTOProperty methods, refer to the QuickTest Professional Object Model Reference.
[ Last edited by lovetest6 on 2005-4-21 at 17:18 ] |
|