You can add to the list of properties that QuickTest uses to identify an object. For each object class, QuickTest has a default property set that it uses for the object description for a particular object. You can use the Add Properties dialog box to change the properties that are included in the object description. You can do this for objects in the local object repository using the Object Repository window or Object Properties dialog box, and for objects in the shared object repository using the Object Repository Manager.
Note: You can also add any valid test object property to a test object description, even if it does not appear in the Add Properties dialog box..
Adding to the list of properties is useful when you want to create and run components on an object that changes dynamically. An object may change dynamically if it is frequently updated, or if its property values are set using dynamic content (for example, from a database).
You can also change the properties that identify an object if you want to reference objects using properties that were not automatically learned while recording. For example, suppose you are testing a Web site that contains an archive of newsletters. The archive page includes a hypertext link to the current newsletter and additional hypertext links to all past newsletters. The text in the first hypertext link on the page changes as the current newsletter changes, but it always links to a page called current.html. Suppose you want to create a step in your component in which you always click the first hypertext link in your archive page. Since the news is always changing, the text in the hypertext link keeps changing. You need to modify how QuickTest identifies this hypertext link so that it can continue to find it.
The default properties for a Link object (hypertext link) are text and HTML tag. The text property is the text inside the link. The HTML tag property is always A, which indicates a link.
You can modify the default properties for a hypertext link for the object that was recorded so that you can identify it by its destination page, rather than by the text in the link. You can use the "href" property to check the destination page instead of using the "text" property to check the link by the text in the link.
Tip: You can use the Object Spy at any time to view run-time or test object properties and values of the objects in the application you are testing. You open the Object Spy by choosing Tools > Object Spy or clicking the Object Spy toolbar button
Note: You can also modify the set of properties that QuickTest learns when it records objects from a particular object class using the Object Identification dialog box. Such a change generally affects only objects that you learn or record after you make the change. You can also apply the changes you make in the Object Identification dialog box to the descriptions of all objects in an existing component using the Update Run Mode option.
To add properties to a test object description:
- In the object repository tree, select the test object whose description you want to modify.
- In the Test object details area, click the Add description properties button .
Tip: For an object in the local object repository, you can also select the required test object and choose Edit > Step Properties > Object Properties, click the Add description properties button , and then perform the following steps in the Add Properties dialog box.
The Add Properties dialog box opens listing the properties that can be used to identify the object (properties that are not already part of the test object description). The value for each property is displayed in the Value column.
Notes: Values for all properties are displayed only if the application that contains the object is currently open. If the application is closed, only values for properties that were part of the object description when the object was learned are shown.
You can resize the Add Properties dialog box to enable you to view long property values.
You can click the Define new property button to add valid test object properties to this properties list..
- Select one or more properties to add to the test object description and click OK. You can also double-click a property to add it to the test object description. You can type the first letters of a property to highlight the first property in the list that matches the pattern.
Tip: After you add a new property to the object description, you can modify its value
No comments:
Post a Comment