|
When using programmatic descriptions from a specific point within a
test object hierarchy, you must continue to use programmatic descriptions
from that point onward within the same statement. If you specify a test
object by its object repository name after other objects in the hierarchy have
been specified using programmatic descriptions, QuickTest cannot identify
the object.
For example, you can use the following statement since it uses
programmatic descriptions throughout the entire test object hierarchy:
Browser("Title:=Mercury Tours").Page("Title:=Mercury Tours").
WebEdit("Name:=Author", "Index:=3").Set "Mark Twain"
You can also use the statement below, since it uses programmatic
descriptions from a certain point in the description (starting from the Page
object description):
Browser("Mercury Tours").Page("Title:=Mercury Tours").
WebEdit("Name:=Author", "Index:=3").Set "Mark Twain"
However, you cannot use the following statement, since it uses
programmatic descriptions for the Browser and Page objects but then
attempts to use an object repository name for the WebEdit test object:
Browser("Title:=Mercury Tours").Page("Title:=Mercury Tours").
WebEdit("Author").Set "Mark Twain"
QuickTest tries to locate the WebEdit object based on its name, but cannot
locate it in the repository because the parent objects were specified using
programmatic descriptions.
如果你前面的对象用描述性编程,后面的也一定要用描述性的,不然会出错的. |
|