ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Using Programmatic Descriptions

Using Programmatic Descriptions

原创 Linux操作系统 作者:ipqiaojj 时间:2009-03-14 09:55:42 0 删除 编辑

Using Programmatic Descriptions

When QuickTest learns an object in your application, it adds the appropriate test object to the object repository. After the object exists in the object repository, you can add statements in the Expert View to perform. additional methods on that object. To add these statements, you usually enter the name (not case sensitive) of each of the objects in the object's hierarchy as the object description, and then add the appropriate method.

For example, in the statement below, username is the name of an edit box. The edit box is located on a page with the name Mercury Tours, and the page exists in a browser with the name Mercury Tours.

Browser("Mercury Tours").Page("Mercury Tours").WebEdit("username")

Because each object in the object repository has a unique name, the object name is all you need to specify. During the run session, QuickTest finds the object in the object repository based on its name and parent objects, and uses the stored test object description for that test object to identify the object in your application.

You can also instruct QuickTest to perform. methods on objects without referring to the object repository or to the object's name. To do this, you provide QuickTest with a list of properties and values that QuickTest can use to identify the object or objects on which you want to perform. a method.

Such a programmatic description can be very useful if you want to perform. an operation on an object that is not stored in the object repository. You can also use programmatic descriptions to perform. the same operation on several objects with certain identical properties, or to perform. an operation on an object whose properties match a description that you determine dynamically during the run session.

In the Test Results, square brackets around a test object name indicate that the test object was created dynamically during the run session using a programmatic description or the ChildObjects method.



For example, suppose you are testing a Web site that generates a list of potential employers based on biographical information you provide, and offers to send your resume to the employer names you select from the list. You want your test to select all the employers displayed in the list, but when you design your test, you do not know how many check boxes will be displayed on the page, and you cannot, of course, know the exact object description of each check box. In this situation, you can use a programmatic description to instruct QuickTest to perform. a Set "ON" method for all objects that fit the description: HTML TAG = input, TYPE = check box.

There are two types of programmatic descriptions:

  • Static. You list the set of properties and values that describe the object directly in a VBScript. statement.
  • Dynamic. You add a collection of properties and values to a Description object, and then enter the Description object name in the statement.

Using the Static type to enter programmatic descriptions directly into your statements may be easier for basic object description needs. However, in most cases, using the Dynamic type provides more power, efficiency, and flexibility. 

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

上一篇: 换行连接符号
请登录后发表评论 登录
全部评论

注册时间:2009-02-22

  • 博文量
    140
  • 访问量
    74850