More about showInAutomationHierarchy

September 14, 2009 at 1:00 pm 4 comments

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.

 showInAutomationHeirarchy   

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

showInAutomationHeirarchy1

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” />

Advertisements

Entry filed under: Flex Automation.

How to automate MouseMove interactions? Locale libraries for automation

4 Comments Add your own

  • 1. Hans Muller  |  September 14, 2009 at 3:03 pm

    In the example presented in the first paragraph, Application.Panel.HBox.VBox.Form.Button,
    you’ve said that leaving the non-visual containers out of the path would eliminate HBox and
    VBox. Wouldn’t Form also be eliminated? I assume that Panel remains because it renders
    its title. Not sure what’s to become of Application. You’ve implied that it’s
    showInAutomationHierarchy=”true” but it doesn’t appear in the diagrams. And both VBox and HBox
    can have scrollbars, so doesn’t that make the “visual” containers too?

    The fourth paragraph says “…to find the automationIndex of a certain
    object. (refer the pic in the slow replay)”. What’s the “slow
    replay”?

    The “pictorial representation of the previous example” doesn’t appear
    to exactly correspond to any previous example.

    “The container in flex framework has been set false for this property”. I think
    you mean that the Container class initializes its showInAutomationHierarchy to
    false.

    “…other visible containers set these values to true. (e.g Panel, Form ,
    accordion, View Stack etc)” – ViewStack does not set showInAutomationHierarchy
    to true although it does set showInAutomationHierarchy=true for its IAutomationObject
    children. Why is that? Panel and Accordian also do this to their children.

    Reply
    • 2. raniskumar  |  September 22, 2009 at 12:12 pm

      “Not sure what’s to become of Application. “


      Application is the starting point and it needs to be resolved in the browser.. So we need it as a part of the script.

      And both VBox and HBox can have scrollbars, so doesn’t that make the “visual” containers too?


      If an operation is happening on a container, even if it is not visible in automation hirarchy, it will be consireded part of the script. e.g scrolling, click on the VBox etc.

      What’s the “slow replay”?-

      Here i referred my old post https://raniskumar.wordpress.com/2009/08/26/slow-replay-of-scripts-in-flex3/

      The “pictorial representation of the previous example” doesn’t appear
      to exactly correspond to any previous example.


      I will update this.

      “you mean that the Container class initializes its showInAutomationHierarchy to false.”

      – Yes

      ViewStack, Accordina, Panel – handling ..

      ViewStack is not the correct example.(as view stack as a component is not visible to the user)
      But the case of ViewStack accordian, we need to identify its first level children. E.g for recording and replaying the IndexChange, we need the index of the first children. So if the user is using the VBox or HBox as the first children, we need to ensure that we recognize these as the first children. So we forcefully set the showInAutomationHierarchy=true for the direct children of these components.

      Panel does this for its controlbar children only. The same logic explained above will be applicable in this case.

      Reply
  • […] Refer: Rani Kumar’s Blog [explains and addresses this issue beyond perfection] […]

    Reply
  • 4. Supratim  |  April 16, 2012 at 3:07 pm

    Hi Rani,
    I am struggling with flex automation with flexcomponent inside flex panel,Flex container.Let me describe the problem below:-
    1) In the application I am automating with qtp 10.00 and IE 7 has flex buttons such as maximize,minimize,refresh,ImageButtons on the top-right corner of flex palen and flex containers.Those buttons not getting recognized with QTP.
    2)I have few flex components as flexDropDown,FlexTextArea ,FlexRadio Buttons within Flex DataGrid cells that are not getting recognized by qtp.
    3)For SparkDropDownsList -when there are large number of items in the list ,I am not able to select items which are not getting shown up in the list when it opens the list.

    Please suggest me the required code change so that I can inform me developer accordingly.I have installed latest flex addIn 4.6.
    will VBox,Hbox will help in this case.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

September 2009
M T W T F S S
« Aug   Oct »
 123456
78910111213
14151617181920
21222324252627
282930  

Most Recent Posts


%d bloggers like this: