Flex 3.4 and Flex4 Automation Delegate source code

If you are a Flex Automation test tool user/provider and trying to find how to get the source code of Automation Delegates for Flex SDK 3.4 and 4, get the beta of FlashBuilder downloaded.

FlashBuidler 4 (previously known as FlexBuilder) Beta2 is out and available on Adobe Labs. http://labs.adobe.com/technologies/flashbuilder4/ . 

you can find the source from <installedlocation>/sdks/<sdkversion>/frameworks/projects starting with atuomation.




October 27, 2009 at 10:03 am 13 comments

Flex 4 Automation – New feature list

In Flex4 (the beta available) , automation framework supports the following new features.

  • AIR automation.
  • Marahshalling support for Flex and AIR application. (multi version , different application domain, different security domain etc)
  • Modified custom control handling.
  • Trail for spark automation (only some components are enabled in Beta2)
  • Performance improvement in replaying the script


However the testing tools using the automation framework need to do certain modifications to leverage these new features.


AIR automation of flex controls this includes

  • Windowed application.
  • Multiple window.
  • Drag and drop operations inside AIR applications.

How to get the multiwindow details :
The windows are not children of Application in fact in all-purpose they are independent application instance. Even after closing the main application window the sub application can exists.
Now the automationManager listens to the user interaction on the sub Windows also and will dispatch the record event on these also similar to as it handled on the main window.

The change needed in the tools

You can listen to the  AutomationAirEvent.NEW_AIR_WINDOW from the AutomationManager and get the uniqueId formed for this new window by the automationManager.
You can get the window corresponding to the   id from using getAirWindow  API on the AutomationManager2 passing the window id.  You have to ensure the object received is valid.  (e.g.  getting the window object after the window is closed).

If your tool needs to get the hwnd of the new window,  there is no direct way. However this can be logically handled.  If you would like to know more about this,  or about any of the new features, you can contact me at ranik@adobe.com  (I will try to address this more in further posts as time permits 🙂  )

October 9, 2009 at 6:18 am 9 comments

IE7 and FlexBuilder3 plugin not working for automation using QTP ?

 Are you using FlexBuilder3 plugin and IE7?  Tere was a issue with the Flex Builder 3 Plugin when used with IE7 (http://bugs.adobe.com/jira/browse/FLEXENT-770 ).

This issue was resolved from Flex Builder 3.2 onwards.   Please follow the steps below to get the latest plugin.

  1. Uninstall the existing flex plugin
  2. Download the last Flex Builder 4 QTP plugin zip file http://download.macromedia.com/pub/labs/flex/4/flex4_automation_install_100509.zip
  3. Unzip it in a permanent location and then click on the Install_QTP_Plugin.bat and then restart your machine.
  4. Now try recording the automatable flexstore application http://www.adobe.com/devnet/flex/samples/flex_store_v2/

October 7, 2009 at 6:42 am 6 comments

Using Ant sccript to compile the flex application and enable automation.

If you are using ant script to compile your application and if you would like to link in the automation libraries , you need to use the appropriate compiler arguments. Please  note that placing the automation libraries in the library path and providing the library path using the compiler.library-path wont enable  the applications for automation.

Automation classes wont be added to the application by the compiler just by placing the libraries as the application code does not refer to the automation classes. So the classes needs to be linked in to the application forcefully using the -include-libraries option.

In the ant script this can be used as follows.

This needs to be used in the mxmlc task.

<mxmlc file=”${APP_ROOT}/Main.mxml” keep-generated-actionscript=”true”>

          <compiler.include-libraries dir=”${swf.output}” append=”true”>
                       <include name=”MyComponents.swc” />
                      <include name=”AcmeComponents.swc” />
                    <include name=”DharmaComponents.swc” />


For more details refer  http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html

October 7, 2009 at 6:03 am 2 comments

FlashBuilder 4 – Beta2 is out. Spark components automation for trial

FlashBuidler 4 (previously known as FlexBuilder) Beta2 is out and available on Adobe Labs. http://labs.adobe.com/technologies/flashbuilder4/  check out the new features.

In beta2, Spark components  automation is available for trial. 

Spark Components made automation ready for Beta 2

  • Application
  • Button
  • CheckBox
  • Panel
  • RadioButton
  • ScrollBar
  • TextArea
  • TextInput
  • VGroup
  • HGroup
  • RichEditableText
  • Slider
  • NumericStepper

Automation of these Spark Components is currently supported only for Flex Applications.

Read more about it from the release notes http://labs.adobe.com/wiki/index.php/Flash_Builder_4:Release_Notes#Install_and_Configure_Flex_and_AIR_Automated_Testing 

Try out this and let us know your feedback.  Refer http://labs.adobe.com/wiki/index.php/Flash_Builder_4:Release_Notes#Flex_SDK_Issues – automation for the known issues.

October 6, 2009 at 12:13 pm 4 comments

Using FileReference.browse or FileReference.download ?

In the work flow, if you were using FileReference.browse or FileReference.download, the script replay can fail if you are using the Flash player 10.

Flash player 10 security features does not allow action script level programatic reply of events which triggers  the above operations. i.e These operations work only if it was triggered by the user interaction such as actual mouse click or keyboard click.

Since the automation framework replay happens at the action script level (using the low level events being dispatched on the targets), this will be blocked by the security restriction.

The flash player 10 security enhancement documentation states “In Flash Player 9, ActionScript could perform uploads and downloads at any time. With Flash Player 10, the FileReference.browse and FileReference.download operations may be initiated only through ActionScript that originates from user interaction. This includes actions such as clicking the mouse or pressing the keyboard. “

More about it at http://www.adobe.com/devnet/flashplayer/articles/fplayer10_security_changes_02.html#head3

October 6, 2009 at 12:02 pm 3 comments

How to use automation source in FlexBuilder3

Not able to locate the automation source ?

Do you have a valid professional FB license ? If yes, read further.

As we discussed in the earlier posts, the automation libraries are automation.swc, automation_dmv.swc, automation_flashflexkit.swc

You can find the source for this as follows.

automation.swc  -> C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\frameworks\projects\automation

automation_dmv -> C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\fbpro\projects\automation_dmv

automation_flashflexkit -> C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\fbpro\projects\automation_flashflexkit


Missing fbPro?

If you have a valid professional FlexBuilder license and if you are missing the fbpro location you can get the source in 2 ways.

1. Go to c:/Documents and Settings/All Users/Application Data/Adobe/Flex  ( this is the license-file-location)

2. You will find a file known as license.properties . Take a backup copy of this file and delete it

3. restart your FB. Apply the license again (either you may be asked to enter in the start up itself , else using Help -> manage flexLincense)

4. Once the key is accepted and informed as a valid professional key, check for the fbpro folder again.

Still Missing?

FB is supposed to extract the source and 2.0.1 automation libraries, when the key is accepted. But looks like in some cases, it is not. In those case you can get the source as follows

1. go to C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\lib

2. Check whether you have DMV-source.jar there

3. You should have it. you can extract the source  from command line as

            java -jar DMV-source.jar {license-file-location} {output-location}

you can find more details on this at http://blogs.adobe.com/flexdoc/2008/04/extracting_data_visualization.html

How to use the source for debugging?

If you like to add this source to debug your project.

1. right click on project -> properties

2. Select the Flex Build Path

3. In the source Path tab select the location of the source till src  (e.g C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\fbpro\projects\automation_dmv\src)

If your project was including the swc corresponding to this source, now it will compile using the source. So you can edit the source, you can add break point and debug.

September 24, 2009 at 12:18 pm 7 comments

Older Posts Newer Posts


  • Blogroll

  • Feeds