flex automation. tools comparison
DESCRIPTION
Comparison of tools to be used for Flex automation QA with Selenium.TRANSCRIPT
Lohika
Flex Automation. Tools comparison
Dmitry Irzhov12. 17. 2011
• We define the most appropriate tool to automate flex/flash applications
• Based on a set of utility functions, ability to describe the controls, we define some of the tools more versatile and less costly for automation
Goal
• There are paid tools for automation the flash / flex applications: RIATest, TestComplete, SiktTest, Rational Functional Tester, HP QTP, as well as free: FunFX, FlexMonkey, SeleniumFlex, FlexPilot
• Flex / Flash API extends
• Versioning browsers often grows
Current Situation
• Cross-browser compatibility
• Ability to describe any control with any nesting
• Availability of documentation
• Supporting flex 3&4
• Ability to change / add a set of tool functions
Requirements for the tool
Architecture
Flex/FlashApplication
ExternalInterface
Monkium PilotSFAPI
WebDriver
Selenium Server
Test Script
Functions of the tool
ALP
Locators
• Monkium generates monkeyId for elements which do not specify automationName or id
• Monkium not support chain * (can be described by Container Property / Value)Pilot Monkium SFAPI
id + + +
automationName
+ + +
Property Value
+ + +
Generated Id
- + -
chain + +/- +
Documented functions
• A set of Monkium functions can be found only if write commands in the FlexMonkey
• A set of FlexPilot functions can be seen on the developer's site
• A set of SFAPI functions is described as FlexPilot in the user-extensions.js file
Note: SFAPI contains the largest set of commands
PopUpButton
Action Pilot Monkium SFAPI
click + + +
open - + -
• PopUp arrow button is not accessible
• Need to use native open() method
Edit Field
SFAPI
• document.getElementById('testApp').getFlexProperty('id:ta','text');
Pilot
• document.getElementById('testApp').fp_getPropertyValue({'id':'ta','attrName':'text'});
Monkium
• document.getElementById('testApp').getForSelenium('<VerifyProperty value="ta" propertyString="text" expectedValue="sample" propertyType="equals" prop="automationName"/>', '');
Action Pilot Monkium SFAPI
click + + +
type + + +
getText + + +
ComboBox
Action Pilot Monkium SFAPI
select + + +
type + + +
getText + - +Pilot
• fp_getPropertyValue({'chain': 'id:cardCmb/className:ComboBoxSkin/className:TextInput', 'attrName':'text'}); - unable to use selectedIndex.label
Monkium
• getForSelenium('<VerifyProperty value="cardCmb" propertyString="selectedIndex.label" prop=”id"/>', '');
SFAPI
• getFlexText('id:cardCmb.selectedItem','');
DropDownList
Action Pilot Monkium SFAPI
select + + +
getText + + +
Pilot
• fp_getPropertyValue({'chain':'id:list1/className:*/className:Label', 'attrName':'text'}); - can be returned non-selected label
Monkium
• getForSelenium('<VerifyProperty value=\"list1\" propertyString=\"selectedItem.label\" prop=\"automationName\"/>', ''); - return error on non-selected contro
SFAPI
• getFlexText('id:list1.selectedItem',''); - return wrong selection on non-selected control
List
Action Pilot Monkium SFAPI
select + - +
getSelection + - +
Pilot
• document.getElementById('testApp').fp_select({'id':'myList', 'index':'1'});
Monkium
• Unable to select and get selection if List is with ItemRenderer
Advanced Grid
• Monkium has a small set of commands (HeaderClick, Select)
• SFAPI has a variety of methods (getFlexDataGridUIComponentLabel, getFlexDataGridCell, getFlexDataGridRowCount, etc.)
Tree
Action Pilot Monkium SFAPI
open - + -
select - + -
Monkium
• <UIEvent command="Open" value="myTree" prop="automationName"><arg value="Inbox" /></UIEvent>
• It is not possible to automate custom controls in tree nodes (such as RadioButton or CheckBox)
Pilot
• No methods to work with Tree, but can be implemented using separate controls of Tree
Context Menu
Pilot
• fp_rightClick({'id':'testApp','contextMenuIndex':'1'}); - locator should be the root object of application
Action Pilot Monkium SFAPI
rightClick + - -
ScrollingPilot
• fp_click({'chain':'id:dg/className:VScrollBar/className:Button/className:ScrollBarDownButtonSkin'});
Monkium
• playFromSelenium('<UIEvent command="Scroll" value=\"dg\" prop=\"id\"><arg value="0"/><arg value="2"/></UIEvent>',"");
There are many ways to solve the issue for List control with ItemRenderer:
• Use ensureIndexIsVisible(index) or call Event.CHANGE for ScrollBar
• Setting list.layout.verticalScrollPosition
• Setting ScrollBar.value
Action Pilot Monkium SFAPI
Grid Scroll + + +
List Scroll with Renderer -* -* -*
FlexMonkium Disadvantages
• After performing a dozen commands you can not continue running (only after you restart the application) http://www.gorillalogic.com/forumpost/1011
• The command set can be seen only in the source code or in FlexMonkey
• No support for chain or XPath (Container Property, Container Value)
FlexPilot Disadvantages
• Small set of commands, but they are atomic and based on them can be implemented the missing commands
• The project is poorly developing
• No support for XPath
Resources
SFAPI
• http://code.google.com/p/sfapi/
FlexPilot
• https://github.com/mde/flex-pilot
FlexMonkium
• http://www.gorillalogic.com/flexmonkium
FlasInspector
• https://addons.mozilla.org/ru/firefox/addon/flashinspector-194381/