Slow replay of scripts in Flex3
In Flex3, if the application has lot of component in under one control the replay is observed to be slow. I will explaining what causes this and what the developers can do to over come this, till they are ready to migrate to Flex4 which completely addresses this issue.
What causes this problem?
A lot of controls under one container? what is meant by this in automation terms ?
1. The application has a container which has lot of controls directly placed under the same. e.g under one panel, user placing a lot of controls , i,e one container has 100 buttons, 200 text input etc. I doubt anybody will do such a thing.
2. The container has lot of controls indirectly placed under the same. i.e assume that there is a custom control which comprises of 100 + components and from a container user uses multiple instances of this custom control. Possible , isn’t it?
3. A container has lot of controls unknowingly placed under the same. I think this is most common scenario as it happens without the mistake of the application developer. Assume a canvas has lot of controls and the user has placed them appropriately in HBoxes and VBoxes. So no container has really not many children. But this also will unknowingly cause a lot of children under the same container.
Assume the user has an application structure as follows.
Her no contianer has more than 4 chilren.
Cavas has children of HBox1, C6,C7 and VBox1.
Similarly HBox1 has C1-C4, VBox1 has VBox2, HBox2 and C8.
So ideally the hierachy of C12 will be Application->Canvas->VBox1->VBox2->C12.
But for automation, to make the scrtipts shorter, the Boxes are made not visible in the automation hierarchy. So in this case all controls from C1-C14 will be the children of the Canvas.
So the user inteaction on C12 will be recorded as
i.e th automation hierarchy will be as follows.
This kind of scenario makes one container have a lot of children them for automaton even though user cannot see that in his application code.
What can be done ?
In flex4 automation framework the performance issue is addressed. So even if the user have a lot of controls under one container, replay should be considerably faster.
Till then user can reduce the children of the canvas and make them the children of making ‘visibleInAutomationHeirachy’ property true to the HBoxes and VBoxes.
So they will have the same structure as that of the logical relationship for automation also.
Assume user made VBox1 visible in automation hierarchy, children of canvas will be 7 (i.e C1- C7 and VBox1)
C8 – c14 will be children of VBox1 in that case.
if the user made VBox2 visibleInAutomationHierarchy true, VBox1 children will be VBox2, c8-C11
So user can decide the appropriate Boxes and make them visible to automation , so that children under container will not be many.
Please note that, the script needs to be rerecorded with the new automation hierarchy.