White Master Replace with a graphic 5.5” Tall & 4.3” Wide ® Copyright 2008 Adobe Systems...

Post on 13-Dec-2015

214 views 0 download

Tags:

Transcript of White Master Replace with a graphic 5.5” Tall & 4.3” Wide ® Copyright 2008 Adobe Systems...

White Master

Replace witha graphic

5.5” Tall & 4.3” Wide

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 1

Flex Automation

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 2

Flex Testing

Topics

* Flex Automation Framework Basics

* Custom component automation

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 3

Flex Testing

Functional Testing of Flex Applicaiton

Feasible by using Automation Framework

Flex Application

Testing Tools

Plugin

Flex Automation Framework

Flex to Tool Communication

library

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 4

Flex ApplicationSDK

Delegates

Automation Manager

Tool Library

Tool Plugin

Testing Tool

Centralized communication point between the tool library and

application

Communication handler between tool

and application

QTP, IBM Rational, Silkiest, Compuware, RIA Test, FAAT etc

Communicates via External Interface or

Sockets

Adobe support QTP Plugin and tool

library

Automation Framework

Automation_Manager.swc

qtp.swc

Automation.swc Automation_dmv.swcAu.._flashflexkit.swc

QTP plugin dll(s)

One Delegate for one component

Framework.swc

Flex Testing

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 5

Flex Testing

Delegates

Flex Application

Delegate1

AutomationManger

Component1

•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. 6

Flex Testing

Functional Testing of Flex Applicaiton

Flex Applicaiton

Testing Tools

Plugin

Flex Automation Framework

Flex to Tool Communication

libaray

Env Information between FlexApplicaiton and Tool

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 7

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. 8

Flex Testing

Application compilation

•Static

•-include-libraries and –include-classes

•Use absolute path when this is used in Flex Builder

•Dynamic

RunTimeLoading swf

Delegates

Automation Manger

Tool Library

Main Applicaiton

Testing tool

•Application is recompiled with libraries (and additional classes)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 9

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. 10

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. 11

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. 12

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. 13

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. 14

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. 15

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

Provide the child handler methods

GetAutomationChildAt

Get numAutomationChildren

createAutomationIDPart

resolveAutomationIDPart

createAutomationIDPartWithRequiredProperties

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 16

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. 17

Flex Automation – Custom component

Q & A

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 18

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 19

Flex Testing

Functional Testing of Flex Applicaiton

Flex Applicaiton

Delegates

Flex to Tool Communication

libaray

AutomationManger

Event basedEvent basedEvent basedMixin classes

Event based