As a Flex developer, you can employ techniques to make Flex applications as "test friendly" as possible. These include:
To create "test friendly" applications, ensure that objects are identifiable in scripts. You can set the value of the ID property for all controls that are tested, and ensure that you use a meaningful string for that ID property.
To provide meaningful identification of objects:
When working with Silk4J, an object is automatically given a name depending on certain tags, for instance, id, childIndex. If there is no value for the id property, Silk4J uses other properties, such as the childIndex property. Assigning a value to the id property makes the testing scripts easier to read.
Automation agents rely on the fact that some properties of object instances will not be changed during run time. If you change the Flex component property that is used by Silk4J as the object name at run time, unexpected results can occur. For example, if you create a Button control without an automationName property, and you do not initially set the value of its label property, and then later set the value of the label property, problems might occur. In this case, Silk4J uses the value of the label property of Button controls to identify an object if the automationName property is not set. If you later set the value of the label property, or change the value of an existing label, Silk4J identifies the object as a new object and does not reference the existing object.
To avoid duplicating objects: