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 some usage examples to create automated tests for MyAppInFlex.swf, and also serve as a quick reference on how to interact/access the flex UI.
Click on a ButtonThe easiest way to access an element is using the element’s id, for example click on a button:
Access an element on a GridClick an element that has an specific value on a Grid
Check the value on a TextInputCheck a textbox has a specific value
selenium.flexAssertProperty("id=MyAppInFlex", "chain="id:emailTextBox, firstname.lastname@example.org", );
To improve the application testability, add id’s to the objects you want to access. This also applies for web application in general (accessing elements by id’s is faster than processing xpath expressions).
Some limitationsElements 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.