Functional Testing Framework for AIR AJAX apps based on Selenium

My friends from the Romanian Adobe AIR team have been very busy lately. Marius and Alex have been working on, was to modifying Selenium so you can run automated / functional tests on AIR applications developed with HTML/JS.

To be honest, I am quite amazed about what they managed to pull off in so little time. And because we need your feedback, I have an archive ready for download here, so you can start playing with it in minutes. Here is what it is in ZIP:

  1. demo movies – two movies that show you the workflow supported for now
  2. sample tests – this is the interesting part. You have two applications and some tests files to test these applications with this framework. The first test uses a Selenium based model for dispatching UI events, the second uses a Java AWT robot to generate mouse and key events.
  3. selenium recorder – this lets you record your UI interaction with the application. Then with a little editing on the resulting test files you can create the test cases for your automated testing.
  4. selenium server – this is the heart of this framework. It acts as a proxy between the requests that are made from tests and the AIR application.
  5. readme.txt – for a quick start on trying the samples; this files describes how to create a Java project and run the tests from Eclipse as a JUnit Test Case.
  6. SeleniumWithAIR.pdf – the first draft of documentation for this framework, which includes the known issues.

It should work on Win and Mac, with Java 1.5 or newer and AIR SDK 1.1.

Here is a short explanation of how to quickly run the tests from the ZIP file:

  1. Download the ZIP, and unzip somewhere on your disk
  2. Create a system variable named ADL_EXE and set its value to the full path of the “adl” executable from your local AIR SDK
    Create ADT_EXE env variable
  3. Start the server: selenium/selenium server/runServer.bat
    The Selenium server is started
  4. Run the tests: selenium/sample tests/runTest.bat
    First test runSecond test run

Here is a snapshot of the Eclipse project to run the tests from the ZIP:

Running the tests from Eclipse

So, that’s it! Try these goodies and let me know what you think!

26 thoughts on “Functional Testing Framework for AIR AJAX apps based on Selenium

  1. Pingback: Functional Testing Framework for AIR AJAX apps based on Selenium « Rich Internet Applications

  2. Pingback: Miti’s Blog » Blog Archive » Selenium on AIR

  3. I wish that “HTML/JS” part would have been written in bold or something. I am still waiting for something for those that are using AIR with Actionscript.

  4. I think Mich0u posted without knowing an issue on running multiple tests on the same AIR application. Didn’t replicate as I’m still behind in learning BDD with JDave framework. I will catch up when the thread will grow :)

  5. @Liviu
    It depends on what you want to test in an AIR application. If you want to test user interaction and automate that you can chose any utility that records keystrokes and mouse clicks. Sure I don’t know many people that have professional tools such as QTP fully licensed, but there are tools that can be set to click and scroll for you even though your application is Flex, Actionscript or AIR. One such tool is AutoHotkey.

  6. Pingback: Miti’s Blog » Blog Archive » Selenium on AIR

  7. I don’t know why but in time this post became a reference model, trying always to see if the comments are becoming more interesting, and maybe I’ll get smart in testing Flex/AIR applications. But I’m too much of an optimist. C’mon dudes and dudettes give some back, the tool above is really cool. On the other hand maybe you’ll give a try to Flash – Selenium or Fluint. This might become a great post where lots of testing tools for Flex and AIR are indexed while we are waiting for Jason Huggins, now that he is a Xoogler, to give us Selenium on steroids. I can’t wait to see some of that :) and then I can finally say that Selenium is the cure for Mercury poisoning… get it ? :D
    This post can also be useful for those trying to make a project involving automation testing process promoted by Adobe Media Player Team Romania.

  8. I know this seems off topic but can anyone knows any video with Jason Huggins keynote speech at GLSEC 2008. It seems like the next great thing in providing full visual on how the tests are going (you did it to by adding those Camtasia captures in the archive :). While I wait on that I can also point out such a tool which are helping us a lot in providing great quality feedback to our management and stakeholders. It’s called Jing and with it the proof of an error becomes more than mere words on paper :)
    But that is just me. Any ideas on that? please share.

  9. I realized that I didn’t stick to much to the topic of the post and didn’t gave more tools on AIR / Flex testing – blame it on my admiration of Jason Huggins work :) .
    A really good start in beginning TDD on Flex or Coldfusion is Charlie Arehart presentation. It is also great to look at his site where he indexed around 700 tools that helps a lot when developing applications using Adobe products.
    On testing tools since I mentioned Fluint it will be good for anybody to check FlexCover and get right amount of feedback on their code. :)

  10. Looks like this tool is only for AIR written in Javascript&html. We hope to use this tool to test our AIR application written in Action Script. Does anybody know if this is doable?

    thanks,Joe.

  11. Hi,
    We have been evaluating the tools selenium, flash selenium and selenium flex api for automating the functional testing of an flex application. We find the tools very promising, I tried to use this tool(seleniumforflex) for testing an AIR application using the same code that relies on the java scrpt interaction with the externalized methods of the selenium launched AIR application. I tried this tool to test our application(swf file) directly not an exe file wrapped in html. I was not successful with that and it is not recording the user interactions with the UI. My question is two fold:
    1. How do we integrate this tool to test a AIR SWF with flash selenium?
    2. If we cannot do the above, how do we record the test based on the user interactions with the UI.
    Hope to get a reply soon. Thanks in advance.
    –Srinu

  12. I was very excited to see Adobe AIR Flex, until I discovered there are no viable automated testing products that will work with it. Somebody please prove me wrong. Adobe recommends mercury QTP, but the adobe at_API libraries MUST be compiled in with the AUT. That’s a problem for us and mercury won’t support it. FlexMonkey looked very promising, (no instrumentation required), but one promblem, doesn’t work with AIR. I’ve had very good luck using C#/UIAutomation and (aging) WinRunner, but neither on of them will work with AIR. Is anybody out there automating (ActionScript) AIR applications?

  13. Pingback: Flex相关的一些开发例子与教程资源集合 | 中文Flex例子

  14. Pingback: Confluence: Quality Management

  15. Pingback: Functional Testing Framework for AIR Apps

  16. A great idea though I could not even run sample test I keep encountering error – Browser not supported *air, with the list of supported browsers as –
    #################################
    Supported browsers include:
    *firefox
    *mock
    *firefoxproxy
    *pifirefox
    *chrome
    *iexploreproxy
    *iexplore
    *firefox3
    *safariproxy
    *googlechrome
    *konqueror
    *firefox2
    *safari
    *piiexplore
    *firefoxchrome
    *opera
    *iehta
    *custom
    #################################

    Which certainly misses *air as browser!
    Is there any thing I could do rectify it?
    I could provide feedback only once I could be in position to use it.

  17. Looking like this tool is written for AIR only using Javascript and also html. I will test this tool shortly and give you feedback. Hope this tool works well for me.

  18. Hi, I explored the tool and it looks good.
    Can i know when will it be available publicly.
    And whom to contact.

  19. Hi Mihai,

    It seems you made a great start on this, but that you have lost interest in the mean-time…

    Do you have any plans to continue work on this project? It’s the one remaining piece of the AIR+JS puzzle that’s still missing.

    Maybe contacting Adobe about some support in picking this up again??

    Cheers,
    -Chris

  20. Using this to test.
    Got the demo working.
    Application is working properly – but when I use the testing framework I’m getting error in introspector mainly about loading outside scripts. What can I do to remedy this problem?

    Thanks!

  21. This tool looks very useful for testing AIR applications with Javascript.

    However, it seems that development has stopped, and other people can’t help improve this tool because the distributed selenium-server-1.0-SNAPSHOT-standalone.jar in the zip file only contains the compiled .class files (e.g. org\openqa\selenium\server\browserlaunchers\AIRLauncher.class).

    Would it be possible to make the source available for your modifications to selenium server so that other people could continue developing it?

  22. Pingback: | Eugene Ware

Leave a Reply

Your email address will not be published. Required fields are marked *