More about showInAutomationHierarchy
In one of the previous post regarding the slow replay, I have refered using showInAutomationHierary. Here i am trying to cover the conceptual details of this property. So when a new component is developed, one can decide about the appropriate value of this accordingly.
In Automation, information about an object is the collection of object information from the application till the object is reached. So basically if an object has the hierarchy as Application.Panel.HBox.VBox.Form.Button the script also should look like the same. But this will have two impacts. One long script lines, which indirectly means more objects details to represent the button.
So from the beginning of the Automation support the decision is made as follows. The non visual containers wont be shown in the script. Which means in the above example, HBox and VBox wont be shown in the list.
This information is represented in the “showInAutomationHierarchy” property of an object. In automation framework it has more meaning to it. Automation framework analyses all children of a container to find the automationIndex of a certain object. (refer the pic in the slow replay). So in the case of the example above, all children of the Panel will be the collection of all its container children who are not visible in the AutomationHierarchy. i.e here the tree will be flattened till the hierarchy reaches a visible object in the chain.
So, let us take an example of Application.Panel.TextInput.Input as the scriptline vs its actual structure of Application.Panel.HBox.VBox.TextInput.Input
Note: The picture represents the details from Panel.
So here even though Panel had only 3 children, since the HBox an VBox are not visible in he hierarchy, it has 6 children when analysing the children in automation framework.
So the automation hierarchy will be as follows
The logic of these value in some of the framework classes is explained to make the concept clearer.
The container in flex framework has been set false for this property. So any component which is inherited from the container, if visible in the application and found logical to be seen in the script, can set these values true.
So in container.as it can be seen that showInAutomatioHierarchy = false; and the other visible containers set these values to true. (e.g Panel, Form , accordion, View Stack etc
And reverse is applicable for a component. i.e by default uiComponent this value is true and any component which inherits from UIComponent but does not really represent a visual component can make this flag set to false. e.g SWFLoader. But an Image which is inherited from SWFLoader makes this as true as it is a visible component.
Even though framework sets these values as preferred for the default usage, the application developer can change the default values by setting the appropriate value for these in the application code itself.
e.g <mx:HBox showInAutomationHierarchy=”true” />
Entry filed under: Flex Automation.