Archive for the ‘Flex monkey’ Category

Automation testing with Flex Monkey (Reloaded) and Maven

August 8, 2011 Leave a comment

Lately there are lot of questions on the flex monkey forum running the functional testing with maven. However there are more questions related to converting the ant script into maven stuff.

Thought of posting the steps that we use to run the automated testing with maven.

Create a maven profile to run the automation tests only when you need that. This will obviously save some time when you dont need to run each time, since you are not running it part of the maven build lifecycle.  More information on build profiles can be found at this link

Maven-antrun-plugin provides the ability to run ant tasks from maven.


<tasks unless=”maven.test.skip”>
<delete file=”${basedir}/automation/”/>
<copy file=”${basedir}/automation/”
<ant antfile=”${basedir}/automation/build.xml”>


If you see the above code, it runs the antfile “build.xml” which is in automation folder. The are the files which is needed for my application to set the channel end points ( channel Endpoint url are different for  development, scrum, qa and also for prod). The configurations can be used to override the properties file used by ant to change the channel configuration.

There are many ways to dymanically change the channel configuration run-time by loading xmls.., changing serverconfig data and also by changing the services-config url as well etc..,

The libraries which are added in dependency section are need to generate the Junitreport tasks.

If you run the build.xml within flex builder, it would run the “junitreport” task without any issue. Since it would use the built-in jar available within flash builder plugins sections. But when running with maven, you need the above dependencies artifacts (ant , ant-optional and ant-apache-xalan2) for the report generation to work.

Here is the core part of the build XML which is used to run the generated flex unit tests (either recorded ones as well by flex monkey)

    <target name=”execute_test” depends=”initTest”>
verbose=”true” />

<echo message=”Flex Monkey reports are generated to ${report.dir}” />

<junitreport todir=”${report.dir}”>
<fileset dir=”${report.dir}” >
<include name=”TEST-*.xml”/>
<report format=”frames”  todir=”${report.dir}/html”/>

Curious to know if there is any effective way to run automated testing for your flex apps. Please could you mention that in comments section.

Categories: Flex, Flex monkey, Testing