Custom Component automation presentation

Flex Automation
Replace with
a graphic
White Master
5.5” Tall & 4.3” Wide
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
1
Flex Testing
Topics
* Flex Automation Framework Basics
* Custom component automation
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
2
Flex Testing
Functional Testing of Flex Applicaiton
Feasible by using Automation Framework
Flex Application
Testing Tools
Flex to Tool
Flex Automation Communication
Framework
library
Plugin
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
3
Flex Testing
Framework.swc
Flex Application
SDK
Automation.swc
Automation_dmv.swc
Au.._flashflexkit.swc
One Delegate for one
component
Centralized communication point
between the tool library and
application
Delegates
Automation Manager
Automation
Framework
Automation_Manager.swc
Communicates via
External Interface or
Sockets
Tool Library
Communication
handler between tool
and application
qtp.swc
Tool Plugin
QTP plugin dll(s)
Testing Tool
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
Adobe support QTP
Plugin and tool
library
4
QTP, IBM Rational,
Silkiest, Compuware,
RIA Test, FAAT etc
®
Flex Testing
Delegates
Flex Application
Automation
Manger
Component1
Delegate1
•Instance of the delegate class gets added for each instance of a component
•Delegates know about the component which is associated
•It adds listeners to interested events of the component
•Decides what to do, when an event occurs and calls appropriate methods on
Automation Manger
•Can provide additional methods which will be interested for testers
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
5
Flex Testing
Functional Testing of Flex Applicaiton
Flex Applicaiton
Testing Tools
Flex to Tool
Flex Automation Communication
Framework
libaray
Plugin
Env Information between
FlexApplicaiton and Tool
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
6
Flex Testing
Delegates
•New delegate information needs to be added to the env file
•The list of events handled by the delegate
•The list of additional methods provided if any
•List of properties applicable to this object related to testing
•New delegate information needs to be added to the application compilation
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
7
Flex Testing
Application compilation
•Static
•Application is recompiled with libraries (and additional classes)
•-include-libraries and –include-classes
•Use absolute path when this is used in Flex Builder
•Dynamic
RunTimeLoading swf
Main Applicaiton
Delegates
Testing tool
Automation Manger
Tool Library
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
8
Flex Testing
Points to take care
•Overlapping container
•Usage wmode
•Licensing
•Usage of special js file
•Custom components
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
9
Flex Automation – Custom component
What all needs to be supported to automate a component ?
Record support of the user interactions.
Replay support of the recorded script
Allowing verification of the properties of the object
Allowing to get the tabular representation of the object (if applicable)
Provide test friendly methods to get specific data from the component.
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
10
Flex Automation – Custom component
What is a custom component
A component extending from a standard component
(No additional events, no additional properties)
A component extending from a standard component –
Additional events/ additional properties
A component extending from a non container class, but the current class is a container.
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
11
Flex Automation – Custom component
Case 1: Component extending from a standard component
– No additional events or properties
E.g. user creates an MyAdvancedDataGrid extending from AdvancedDataGrid.
i.e no special user interaction possibilities on it other than the base component.
E.g. user creates MyComponent extending from Panel and have some controls in it.
i.e the new component is a container, and the base also a container.
What to do here?
Nothing. The base component automation (delegate) will take care of the needed.
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
12
Flex Automation – Custom component
Case 2: Component extending from a standard component
– Additional events or properties
E.g. user creates an MyAdvancedDataGrid extending from AdvancedDataGrid.
and there is a new event which needs to be recorded.
User extends from a component, but wishes to expose a behavior which is different
from that of the standard component.
What to do ?
Create a new Delegate
Add in the new delegate to the application using -includes
Provide the details of the component in the XML file
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
13
Flex Automation – Custom component
Case 2: Component extending from a standard component
– Additional events or properties - continues
What to do in the delegate
Add Event listener to the interesting event
Identify the details of the event which is needed to replay the event later
Pass the event to record to the automation manager.
Handle the replay of the event.
•Identify the user interaction component and replay the click on that component.
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
14
Flex Automation – Custom component
Case 3: A component extending from a non container class,
but the current class is a container
What to do in the delegate ?
Expose the required children.
GetAutomationChildren
GetAutomationChildAt
Get numAutomationChildren
Provide the child handler methods
createAutomationIDPart
resolveAutomationIDPart
createAutomationIDPartWithRequiredProperties
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
15
Flex Automation – Custom component
General concepts
Automation Name
Tabular check point
Adding new properties for verification
What is codec?
Role of showInAutomationHierarchy
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
16
Flex Automation – Custom component
Q&A
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
17
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
18
Flex Testing
Functional Testing of Flex Applicaiton
Flex Applicaiton
Delegates
Automation
Manger
Mixin
Eventclasses
based
Event
based
Flex to Tool
Communication
libaray
Event based
®
Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential.
19