ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Retrieving and Setting Test Object Property Values

Retrieving and Setting Test Object Property Values

原创 Linux操作系统 作者:ipqiaojj 时间:2009-03-14 10:41:54 0 删除 编辑

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 or component, QuickTest creates a temporary version of the test object that is stored in the test object repository. You can use the GetTOProperty, GetTOProperties, and SetTOProperty methods in your function library 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 run session, any changes you make using the SetTOProperty method apply only during the course of the run session, 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 run session as follows:

link_href = Browser("HP Technologies").Page("HP Technologies").Link("Jobs").GetROProperty("href")

Tip: If you do not know the test object properties of objects in your application, you can view them using the Object Spy. For information on the Object Spy, see Understanding the Test Object Model.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16792402/viewspace-567248/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-02-22

  • 博文量
    140
  • 访问量
    73570