Thursday, July 3, 2008

Selenium Testing Flex

At the end of 2007, I was researching functional test tools (preferably open source) for testing Flash or Flex applications.

As I was familiar and very satisfied with Selenium for testing Web Applications I decided to put some effort on trying to use Selenium for driving my Web Flex Application functional tests.

With some work (in fact not too much work—kudos to Selenium) I had a working solution and was successfully using Selenium to test a deployed Web application with a Flash component (SWF).

As a result of this effort, Flash-Selenium has been created and open sourced.

http://code.google.com/p/flash-selenium/

Also a recent article on adobe.com describes Flash-Selenium usage in more details:

http://www.adobe.com/devnet/flash/articles/flash_selenium.html

11 comments:

XG said...

Hi Paulo,

Thanks for your efforts to make selenium testing flex worked. I am assigned to have my company flex project automated. I read the articles mentioned under following link of http://www.adobe.com/devnet/flash/articles/flash_selenium.html. And I run the color click sample on my PC successfully.

I want to make it work on my real project. But I got a block on login page. Would you mind let me know how to type into username and password and click login button on a flex page? Do you have any sample code which could be shared?

Great thanks

XG.

YogB said...

Nice article.

One question I have. I am using Selenium RC with FlashSelenium using test scripts in c#.

I would get exception when using flashapp.GetvAriable(varName). My application uses Flash 9 with Action Script 3.0. Do you have any idea if GetVaribale and other functions are available with this settings ? I refer to http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03.html but it says about functions available for scripting with flash 5. Flash 9 with AS3 still have those functions ?

Thank you very much

stone said...

Is there anyway to use the FlashSelenium tool to access the objects in the SWF without having to use the ExternalInterface? I need to test a Flash application that is written without this class.

Paulo Caroli said...

Please take a look at FlexUISelenium:
http://code.google.com/p/flex-ui-selenium/The combination of FlexUISelenium and Selenium RC allow you to access (and test) Flex UI components. And you don’t have to deal with adding ExternalInterface.

manu said...

HI Everyone,

I am having 2 links with same properties in a Flex application. how can i identify and click both the links through selenium.

Thanks & Regards,
Manoj

praveen said...

hi,

I have one question? how to create the automation for the web site which is having tabs. my flex application first page having username and password after login successful i will go the next page in this page i am having the two tabs in the default tab i can enter data using my java program. but i am not able to go for the next tab.

i refered the example given from the following links.

http://code.google.com/p/flex-ui-selenium/

please guide me how i can create the automation for my flex application using the selenium


Thanks

roopesh said...

Hi ,

I tried to automate sample Flex-base calculateSum application and it is working fine for me , but when I am trying to automate my application i am getting 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 application i.e.

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

after this point if i will try to use flexApp object i am getting above error .

Please help .

Many Thanks in advance

Regards
Roopesh

Anyong said...

Hi Paulo

i am getting errors while doing color click sample project with Selenium RC for flex applications? can you give me some idea..

viksy said...

Hi Paulo,

Thanks for the information. Did you use any extra plugin like flex monkium? Or is there any way we can automate testing using selenium without writing external callbacks and all.

Unknown said...

how to integrate selenium C# webdriver with Flex ?

vijay kumar said...

Hi,
Can any one tell me how to test flash apps using selenium.I read all comments and i didnt get proper clarification.Please share your ideas.
Thank you.