I continue automating my Flex application with FlexPilot. One clear advantage I found when using FlexPilot is that I was able to access more of the UI elements of a complex Flex interface. The other tools I tried weren't picking all those elements, but I must admit that I didn't investigate further.
An interesting feature is FlexPilot’s chain syntax, that allows to access flex UI elements by different properties, like id, label or text. Another feature I liked is easier integration to work with selenium RC and selenium IDE.
Below are some usage examples to create automated tests for MyAppInFlex.swf, and also server as a quick reference on how to interact/access the flex UI.
Click on a Button
The easiest way to access an element is using the element’s id, for example click on a button:
If the button you are trying to access doesn't have an id, you are able to find it using the
Access an Element on a Grid
Click an element that has an specific value on a
Check the Value on a TextInput
textbox has a specific value:
To improve the application testability, add
ids to the objects you want to access. This also applies for web application in general (accessing elements by
ids is faster than processing xpath expressions).
Elements on a grid can't be accessed by position, for example, click on the first/second element on a grid.
I've been experiencing some issues with some application builds that prevent the use of the flex explorer and recorder (reported the bug, hopefully it gets fixed soon). You can still run the tests, just not using those tools to capture the elements.