About the application hierarchy
In the object repository, objects are stored in a hierarchy. The root of the hierarchy is the
browser. The next element is the Flex application. Under that are the containers and controls
that make up the application.
In the QTP Object Repository and Keyword View, a tree-like structure represents the levels of
containers in the application. In general, the hierarchy follows the way the application appears
visually. In the MyApp Flex application, for example, for a Button labeled Submit inside a
TabNavigator's view labeled Change Settings, the hierarchy appears like this:
Browser
|
Application ("MyApp")
|
Panel ("Change Settings")
|
Button ("Submit")
In QTP scripts, you use dot-notation syntax to access an object, and a dot separates each level.
To refer to the Button, you use a path like the following:
Browser("Home").FlexApplication("MyApp").FlexPanel("Change Settings").
FlexButton("Submit")
For information on how a QTP script shows Flex applications, see
on page
13.
Although containers, such as HBox or Panel, are contained in a TabNavigator container, the
TabNavigator itself does not appear in the hierarchy. To improve script readability, some Flex
containers are omitted from the hierarchy if the container has no impact on the testing.
The application hierarchy is also called the display hierarchy, because it generally represents
what you see on the screen in a tree-based layout. The display hierarchy is not always the same
as the automation hierarchy, which is the hierarchy of objects as they are referred to in the
QTP scripts. Sometimes containers that appear on-screen (for example, with a border or in a
window) are part of the display hierarchy, but not part of the automation hierarchy.
In general, if a container does not appear on the screen, it does not appear in the testing
hierarchy. For example, a stand-alone HBox container is often used to lay out content, but it
has no visual representation and does not appear in the test scripts. The exception to this is
when the HBox is a child of TabNavigator. In this case, the HBox is needed to uniquely
identify its contents, and therefor it is part of the hierarchy. For more information about using
the TabNavigator and other containers, see
"Working with containers" on page
"About the testing script"
21.
Test creation overview
11
Need help?
Do you have a question about the FLEX 2-TESTING FLEX APPLICATIONS WITH MERCURY QUICKTEST PROFESSIONAL and is the answer not in the manual?
Questions and answers