Flex is a highly productive, free open source framework for building and maintaining expressive web applications that deploy consistently on all major browsers, desktops, and operating systems.
Test Automation involves automation design and execution of automated tests. The Flex test automation feature provides developers with the ability to create Flex applications that use the automation APIs. These APIs can be used to create automation agents or to ensure that applications are ready for testing.
This session would cover basics of Flex Test Automation. One of the many available tools to be touched upon in this session would be FlexMonkey – a testing framework for Flex applications that provides for the capture, replay and verification of Flex UI functionality.
Report
Share
Report
Share
1 of 28
Download to read offline
More Related Content
Test Automation in Flex - Richa Sharma
1. Test Automation In Flex
Richa Sharma
SAS Research And Development (India)
2. Agenda
• Automate It!
• The Flex Automation Feature
• Prepare to Automate
• Automated Testing Workflow
• Instrumentation
• FlexMonkey – A dekko
• Summary
• Q&A
4. Automate It!
• Flex provides an automation feature which
makes Flex applications automation
enabled.
• Flex Automation APIs aid in creating
custom agents or ensuring the readiness
of Flex applications for testing.
• Flex also provides support for the
automation tool – QTP.
6. The Automation Libraries
• Automation libraries – delegate implementations
for Flex framework components
• automation.swc
• automation_agent.swc – generic agent mechanism
• automation_dmv.swc – delegates for charting and
Advanced DataGrid components
7. Prepare to Automate
• Prepare the application:
• Use automation at runtime
• Use automation at compile-time (Make your own
testable application)
• Prepare customized components for testing
• Deploy the application
8. Prepare to Automate - Runtime
• Automation at runtime
• Wrapper SWF file compiled with automation
libraries
• The SWF uses SWFLoader to load the
application SWF
9. Prepare to Automate – Compile time
• Make your own testable application
• Compile the application with the automation
libraries
• Requires access to Flex application
• Embedding of functional testing classes
increases the size of the SWF
10. Prepare to Automate
• Points to remember while developing:
• All testable controls should have ids
• Unique ids
• Containers can be excluded from being tested
if not impacting the test
• UIComponent class – showInAutomationHierarchy
• Can be avoided:
• Same labels for multiview containers like
TabNavigator
• Dynamically adding children
11. Prepare to Automate
• Points to remember while testing:
• If automation is used at compile-time
• Look out for inflated SWF files
• Remove references of automation libraries from
SWF before deploying on production server
17. Instrumentation
• Requirements for instrumentation of a
custom component:
• Delegate class
• Appropriate entry in the class definition file
18. Instrumentation – The Delegate
• For instrumentation of a custom component with
a delegate:
• Create a delegate that
• is a mixin
• implements the required interfaces
• Register the delegate with AutomationManager
• Define the component in the class definitions xml
19. Instrumentation – The Class
Definition File
• Information about all the instrumented Flex
components
• Tells the automation agent:
• What is the name of the component
• What events can be recorded and played back
• What are the testable properties
21. Instrumentation – Considerations
• Composition – single/composite component
• Container Hierarchy – understanding the
automation hierarchy
• Automation name – clear, unambiguous names
for easy referencing
22. FlexMonkey – A dekko
• FlexMonkey is an Adobe AIR application used
for testing Flex and AIR based applications.
• Records, plays back and verifies Flex UI
interactions
• Generates ActionScript-based testing scripts that
can be easily included within a continuous
integration environment.
24. To summarize…
• Flex applications can be automated using the
Flex Automation APIs
• Applications can be prepared to use automation
at:
• Run Time
• Compile Time
• Custom components need instrumentation:
• Delegate
• Entries in the class definition file
25. Learnings
• Components need a unique id
• Containers not affecting the test can be avoided
• Different labels are needed for multiple tabs in
TabNavigator, Accordian etc.
• Component display hierarchy can be different
from Automation hierarchy
26. Latest on Flex Automation
New in FlashBuilder 4 automation:
• Automation of Flex 4 AIR applications
• Automation of Flex 4 applications
• mx.core.Application, Halo – supported
• Spark based applications – not supported
• Automation of Marshalled Flex and AIR applications