-
Notifications
You must be signed in to change notification settings - Fork 30
To utilize the following you will need Flash testing enabled in your application: Flash Testing Setup
- Each of these are passed as properties on a params object that is passed to the flex-pilot API calls.
These can be arbitrary properties on the DisplayObject you are looking up:
locator | example |
---|---|
*attr (automationName etc) | *value |
id | howdyButton |
name | testTextArea |
chain | name:testTextArea/name:UITextField18 |
The chain is a similar conceptual implementation to XPath, iterating recursively through the display list building a path back to a specific DisplayObject. If you have a reliable attribute like ID or automationName your tests will run faster and the Windmill Bootstrapper will use fewer resources.
Each of the above also accept wildcards and can be used in the following way:
name:testTextArea/name:UITextField18
Could be represented by:
name:testText*rea/name:U*TextField*
The way this works is by creating a regular expression of (.*)
for each occurrence of *
in the locator string. Then a ^
is prepended and a $
is appended creating a strict RegEx that may look something like the following:
/^UITextField(.*)$/
All method take their required params as an object:
document.getElementById('devMovie').fp_click({name:'testTextArea'})
or
document.getElementById('devMovie').fp_type({name:'testTextArea', text:'WHATEVER'})
method | params | description |
---|---|---|
fp_click | locator (optional label, for accordions etc) | click display object |
fp_doubleClick | locator | double click display object |
fp_type | locator, text | type ‘text’ into the display object found by the locator lookup |
fp_select | locator, val | select ‘val, label’ from the specified combo box display object |
fp_dragDropElemToElem | locator, opt locator (meaning prepend opt to the second locator), ie. optchain, or optid (optionally an offsetx and offsety to ‘nudge’ the destination if needed) | drag a display object to the coordinates of the display object ‘opt’ |
fp_dragDropToCoords | locator, coords | drag a display object ‘locator’ to a specified x,y |
fp_lookupFlash | locator | lookup a display object in the display list |
method | params | description |
---|---|---|
fp_assertDisplayObject | locator | assert a display object exists, ‘locator’ |
fp_assertProperty | locator, validator | assert a display object ‘locator’, contains a specified property ‘validator’ (property pipe value) |
fp_assertText | locator, validator | assert a specified input field ‘locator’ equals text ‘validator’ |
fp_assertTextIn | locator, validator | assert a specified input field ‘locator’ contains text ‘validator’ |
(These methods are actually part of the flex-pilot extension to Selenium IDE and RC)
method | params | description |
---|---|---|
waitForFlexReady | target, timeout | Wait for a flash/flex object’s testing API to be available |
waitForFlexObject | target, locator | Wait for an object inside the flex or flash object to be ready to interact with |
- target: identifies a DOM node on the page representing a flash/flex object
- locator: a chain/flex-pilot locator helping access a displayObject inside of flash/flex
(The following assumes your flex/flash object has an ID of testApp, and a flex button with an ID of howdyButton)
<tr>
<td>open</td>
<td>/flexpilot/</td>
<td></td>
</tr>
<tr>
<td>waitForFlexReady</td>
<td>id=testApp</td>
<td>20000</td>
</tr>
<tr>
<td>waitForFlexObject</td>
<td>id=testApp</td>
<td>chain=id:howdyButton</td>
</tr>
<tr>
<td>flexClick</td>
<td>id=testApp</td>
<td>chain=id:howdyButton</td>
</tr>
method | params | description |
---|---|---|
fp_explorerStart | none | enable the explorer |
fp_explorerStop | none | stop the explorer |
fp_recorderStart | none | enable the recorder |
fp_recorderStop | none | disable the recorder |
method | params | description |
---|---|---|
fp_explorerStopped | none | called on the flash obj parent page when the explorer is stopped |
fp_explorerSelect | locator for selected item | receives a selected item from the flash movie |
fp_recorderAction | action to record | receives a recorded action from the flash movie |