Sunday, May 17, 2009

FlexUISelenium for testing Flex UI with Selenium

Due to the high number of requests for making FlashSelenium directly test the UI components of a Flex application, I got involved in a new open source project: flex-ui-selenium. The new component, FlexUISelenium, is used with Selenium RC for testing Flex UI interactions.

FlexUISelenium is an extension to the Selenium RC client driver that enables the Selenium RC client drivers to interact (and test) the Flex UI components and methods of the Flex application.

Here is a sample test code using FlexUISelenium:

public void sumForValidNumbers() {
assertEquals("5", flexUITester.readFrom("result"));

FlexUISelenium uses Selenium RC, Flash Selenium and Selenium Flex API. FlexUISelenium uses FlashSelenium for enabling the communication of Selenium RC client with the Flash application (swf). And Selenium Flex API exposes all the UI components of the Flex application which are built with SeleniumFlexAPI.swc.

The first public release has just been uploaded to the project page.

Enjoy it!


dah carrim naum mah said...

It's very nice! I will try it as soon as I can

John Waggener said...


'IMPORTANT: FlashSelenium is unstable with Selenium RC 1.0. I am currently working on a fix. All was good until Selenium RC version 0.9.2...'

So I downloaded Selenium RC .9.

I could not get the example clickcolors to run.

It seemed to refer to

interpreting the browser as IE.

This looks like a great project and I would love to use Selenium to automate testing of my projects. Is it correct to say that if I cannot get flash selenium to work then FlexUISelenium will not work for me? Thanks.

Sachin said...

Hey John,

We're facing some compatibility issue with Flash Selenium with RC 1.0 and are looking into it. Considering the large user base of Flash Selenium, we're sorry that we aren't constantly polishing Flash Selenium. We'll make sure we fix the issue in couple of weeks.

Thanks and we appreciate your feedback.

raj said...


I tried to run the FlexUISelenium sample "" but i get the below error. I even tried to point the app to my local instance, but i get the same error.

I am using Selenium RC 1.0. Is this due to teh open issue with Selenium RC 1.0 and FlashSelenium?

Can you please help me?


com.thoughtworks.selenium.SeleniumException: ERROR: Threw an exception: 'window.document.compareSumFlexObjId' is null or not an object
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(
at com.thoughtworks.selenium.HttpCommandProcessor.getString(
at com.thoughtworks.selenium.DefaultSelenium.getEval(
at com.thoughtworks.selenium.FlashSelenium.PercentLoaded(
at com.thoughtworks.selenium.FlexUISelenium.waitUntilLoaded(
at com.thomson.tssq.j2012.test.FlexUISeleniumTest.setUp(

Darren said...

Thanks for your help. It was great to be able to automate a test for my simple flex apps. But I want to test the more advanced applications now. It can be seen here how to type and click in the Flex app through the selenium testing. But where can we find more information on what else we can do and how to do it, select a value from a selection box or read data from an advanced data grid for example?

Phil said...

Hi all, I've been testing flex apps successfully thanks to Flex UI, but was have hit a hurdle.

I need to test an app using either *chrome or *firefox, but the version I use at the moment only responds to *firefoxproxy.

Has anyone got Flex testing working through firefox by using the *firefox/*chrome commands only, and if so, what set up (version of firefox etc.) have you got?

Much appreciated,

Sachin said...


FlexUISelenium with Selenium RC 0.92 would work well on Firefox 3.0.x. It was our initial platform when we first started this project during which *chrome/*firefox worked without any problem.

Sandeep.S.N said...

Is it possible to make Flex UI Selenium identify a component by its automation name, name etc...

Currently I observed that it only identifies label and ids.

Chaudhry Adnan Riaz. said...


I am new to Flex automation, Adobe says here that To use Flex Automated Testing, you must install Flex Builder 3 Professional. You cannot use Flex Automated Testing with only the Flex 3 SDK. If you do not have a Flex Builder Professional license, your test scripts are limited to 30 actions. If you exceed 30 actions in a test without the Professional license, you will receive a warning that your license is not present.

is this case true for FlexSelenium? can anybody please tell me what licenses do I need to have to automate Flex applications in Selenium?


Sachin said...


I'm afraid that Flex-UI-Selenium doesn't identify the entire set of UI components that Flex offers. This is partly to be blamed on the fact that Paulo's back in Brazil and me being busy this year.

We are looking for contributors who would like to take this forward and if you wish to contribute (or) know someone who wishes to, please drop me a mail and we'll make it happen. :)


Sachin said...


You don't need to pay a cent to use FlexUISelenium/FlashSelenium dude. Selenium and its drivers (and) Flash Selenium are under Apache 2.0 License.

But, if you need to modify the flash application which "might" have been developed using Flex Builder, then you should get the appropriate license from Adobe.

I'm not quite sure, but I guess Adobe requires you to buy Flex Builder license to use their Flex Automation library. Again, not sure about this, so you might want to get a second opinion on this.

Chaudhry Adnan Riaz. said...


I found this article on Flex Builder License and Automation. It says We need to have a valid professional version of Flex Builder at the time of application compilation to get the complete functionality of automation.

@Sachin: You mentioned you guys were looking for contributors, Can I help? :)


eusebiu.blindu said...


Its great that people try stuff but I wouldn't use selenium flash to test anything for now.
Read my blog about this here:

You can correct me if I am wrong.


Roopesh said...


I have tried to automate the calculateSum application and it is working fine for me but when I am trying to automate my application i am getting a below exception

"com.thoughtworks.selenium.SeleniumException: ERROR: Threw an exception: 'window.document.admin' is null or not an object"

for creating the agent i am passing the selenium object and the name of the swf file .

flexApp = new FlexUISelenium(selenium,"admin");

after this if i will do any operation with flexApp object i am getting above exception .

Please help


Author said...

Learn adobe flash,actionscript, as3, html5, flex tutorials

adobe flash,actionscript, as3, html5, flex

Sushma Narla said...

I want to automate drag and drop in my flex applicaiton and iam trying to use function doFlexDragTo.

Please can any one help me to understand how to use it