Archive for September, 2009

How to use automation source in FlexBuilder3

Not able to locate the automation source ?

Do you have a valid professional FB license ? If yes, read further.

As we discussed in the earlier posts, the automation libraries are automation.swc, automation_dmv.swc, automation_flashflexkit.swc

You can find the source for this as follows.

automation.swc  -> C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\frameworks\projects\automation

automation_dmv -> C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\fbpro\projects\automation_dmv

automation_flashflexkit -> C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\fbpro\projects\automation_flashflexkit

 

Missing fbPro?

If you have a valid professional FlexBuilder license and if you are missing the fbpro location you can get the source in 2 ways.

1. Go to c:/Documents and Settings/All Users/Application Data/Adobe/Flex  ( this is the license-file-location)

2. You will find a file known as license.properties . Take a backup copy of this file and delete it

3. restart your FB. Apply the license again (either you may be asked to enter in the start up itself , else using Help -> manage flexLincense)

4. Once the key is accepted and informed as a valid professional key, check for the fbpro folder again.

Still Missing?

FB is supposed to extract the source and 2.0.1 automation libraries, when the key is accepted. But looks like in some cases, it is not. In those case you can get the source as follows

1. go to C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\lib

2. Check whether you have DMV-source.jar there

3. You should have it. you can extract the source  from command line as

            java -jar DMV-source.jar {license-file-location} {output-location}

you can find more details on this at http://blogs.adobe.com/flexdoc/2008/04/extracting_data_visualization.html

How to use the source for debugging?

If you like to add this source to debug your project.

1. right click on project -> properties

2. Select the Flex Build Path

3. In the source Path tab select the location of the source till src  (e.g C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\fbpro\projects\automation_dmv\src)

If your project was including the swc corresponding to this source, now it will compile using the source. So you can edit the source, you can add break point and debug.

September 24, 2009 at 12:18 pm 7 comments

Locale libraries for automation

One has to keep in mind that Automation is a feature supported from Flash Builder/FlexBuilder. So if anybody is using a nightly build sdk, they need to ensure that they provide all the required pieces for automation to work.

Automation need the automation libraries and the locale libraries. (refer https://raniskumar.wordpress.com/2009/08/13/how-to-enable-flex-automation/ for details)

You can place these libraries anywhere on your machine add the paths in the build path of your project.  Even though the main automation libraries (atuomation.swc, automation_agent.swc etc) needs to be added using -include-libraries, the locale libraries can be just placed along with the other locale libraries in the appropriate locale folders.

Since flex3 sdk support English and Japanese only, automation also support these.  However in Flex4 many more languages are supported.  So theoretically these libraries can be used.

If you are  in real emergency to compile an application in an unsupported language, before your translations and the correct locale swc is ready, you can try changing the locale/{foldername} in an available swc to the required locale .You can use the normal zip utilities to open the swc and recreate it.(I have not tried it personally, theoretically this should work).

Note:  The locale libraies for automation are

  • automation_rb.swc
  • automation_agent_rb.swc
  • qtp_air_rb.swc

September 22, 2009 at 1:38 pm 2 comments

More about showInAutomationHierarchy

In one of the previous post regarding the slow replay, I have refered  using  showInAutomationHierary. Here i am trying to cover the conceptual details of this property.  So when a new component is developed, one can decide about the appropriate value of this accordingly.

In Automation, information about an object is the collection of object information from the  application till the object is reached. So basically if an object has the hierarchy as  Application.Panel.HBox.VBox.Form.Button  the script also should look like the same.  But this will have two impacts.  One long script lines, which indirectly means more objects details to represent the button. 

So from the beginning of the Automation support the decision is made as follows. The non visual containers wont be shown in the script. Which means in the above example, HBox and VBox wont be shown in the list. 

This information is represented in the “showInAutomationHierarchy” property of an object.  In automation framework it has more meaning to it. Automation framework analyses all children of a container to find the automationIndex of a certain object. (refer the pic in the slow replay).  So in the case of the example above,  all children of the Panel will be the collection of all its container children who are not visible in the AutomationHierarchy. i.e here the tree will be flattened till the hierarchy reaches a visible object in the chain.

So, let us take an example of Application.Panel.TextInput.Input as the scriptline vs its actual structure of Application.Panel.HBox.VBox.TextInput.Input

Note: The picture represents the details from Panel.

 showInAutomationHeirarchy   

So here even though Panel had only 3 children, since the HBox an VBox are not visible in he hierarchy, it has 6 children when analysing the children in automation framework.

So the automation hierarchy will be as follows

showInAutomationHeirarchy1

The logic of these value in some of the framework classes is explained to make the concept clearer.

The container in flex framework has been set false for this property. So any component which is inherited from the container, if  visible in the application and found logical to be seen in the script, can set these values true.

So in container.as it  can be seen that  showInAutomatioHierarchy = false; and the other visible containers set these values to true. (e.g Panel, Form , accordion, View Stack etc

And reverse is applicable for a component. i.e by default uiComponent this value is true and any component which inherits from UIComponent but does not really represent a visual component can make this flag set to false.  e.g SWFLoader. But an Image which is inherited from SWFLoader makes this as true as it is a visible component.

Even though framework sets these values as preferred for the default usage, the application developer can change the default values by setting the appropriate value for these in the application code itself.

e.g  <mx:HBox showInAutomationHierarchy=”true” />

September 14, 2009 at 1:00 pm 4 comments

How to automate MouseMove interactions?

In Automation, by design the recording of lower level events are prevented.  This is mainly to avoid the unintended recording of events.  Let us take the example of mouse move.  If the automation records the mouse move on any componet, as the user moves the mouse over the application itself, there will get a huge list of unintended script lines. So it makes sense not to unnecessarily increase the script size. 

 But many application uses mouseMove jesture  in many case to bring up menu’s.   Let us take when the user mouse over an image the applicaiton display a menu and  the user clicks on the menu.   In this case, user click on the menu will be recorded.  But since the mouse over was not recorded, while replaying,  the menu itself would not have come up and further work flow will break.

To handle this situation, automation framework allows mouseMove as a replayable event. i.e user can add the script line manually and during the replay of the script,  the work flow will happen as expected.

A sample script line can look as follows.

Browser(“Browser”).FlexApplication(“TicketReservation”).FlexImage(“SelectOption”).MouseMove

September 10, 2009 at 10:02 am 1 comment

QTP 10 Code Hinting Not Working for Flex ?

Flex Automation tips , continues…

If you are using QTP 10 and if you observe that code hinting not working  while recording the flex application, you  can do the following to enable the same.

1. Place the flex and air xml configuration files (TEAFlex.xml and TEAAir.xml) under the C:\Program Files\HP\QuickTest Professional\dat\Extensibility\TEA folder within the QTP installation.

2.Add string value “C:\Program Files\HP\QuickTest Professional\dat\Extensibility\TEA” to HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest\StepInformationManager\TypeInfoFiles node in the registry.

September 9, 2009 at 8:37 am 1 comment

Random walk ,Flex Automation – custom component, replay error

Flex Automation tips , continues…

The custom component automation sample for Flex Automation ‘Random Walk’ was made available during Flex2 times. Using this component with Flex3 sdk and automation cause the following error during the replay of the events.

Error #1034: Type Coercion failed: cannot convert
RandomWalkDelegate@209f6f51 to mx.core.IUIComponent.
The issue can be resolved by the following change in the RandomWalkDelegate.as
 

 

 

 

override public function createAutomationIDPart(child:IAutomationObject):Object
 {
        
var help:IAutomationObjectHelper = Automation.automationObjectHelper;
         return help.helpCreateIDPart(walker, child);  
 }  
   
 override public function resolveAutomationIDPart(part:Object):Array   
 {    
          var help:IAutomationObjectHelper = Automation.automationObjectHelper;
          return help.helpResolveIDPart(walker, part as AutomationIDPart);  
 }

Note the change of the first paramter from this to walker.  Source of the random walk project can be found at  http://www.adobe.com/devnet/flex/samples/randomwalk/

 Refer my post regarding custom components to know about it more 🙂

September 9, 2009 at 7:43 am Leave a comment

Object Identification during Replay

Learn about Flex Automation Framework

Continue Reading September 7, 2009 at 6:28 am 2 comments

Custom component Automation – Introduction

Flex Automation

Continue Reading September 1, 2009 at 7:05 am 4 comments


Calendar

September 2009
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
282930  

Posts by Month

Posts by Category