Click here to Skip to main content
13,089,536 members (70,625 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


Posted 24 Oct 2010

Automating MyAppInFlex.swf – Useful FlexPilot commands

, 24 Oct 2010
Rate this:
Please Sign up or sign in to vote.
Useful FlexPilot commands

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:

selenium.flexClick("id=MyAppInFlex", "chain=id:okButton");

If the button you are trying to access doesn't have an id, you are able to find it using the label property:

selenium.flexClick("id=MyAppInFlex", "chain="id:buttonBar/label:Search");

Access an Element on a Grid

Click an element that has an specific value on a Grid:

AdvancedListBaseContentHolder*/text:Maria Marcano");

Check the Value on a TextInput

Check a textbox has a specific value:

selenium.flexClick("id=MyAppInFlex", "chain="id:emailTextBox, 
validator=text|", );

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).

Some Limitations

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.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Denmark Denmark
No Biography provided

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.170813.1 | Last Updated 24 Oct 2010
Article Copyright 2010 by mariangemarcano
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid