Enabling Flash Player logs Flex Applications

Issue :

Enabling Flash Player logs Flex Applications [Windows 7, 2008, Vista]

Solution :

To enable flash logs,

All you need to do is to create file called “mm.cfg” at the location

For eg : C:\Users\< your windows username>

A complete list of the locations for different OS can be found at refer :

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7fc9.html

 [note : Ensure you have Debug version of Flash player, you can check that by using the Flash player Version test link :

http://kb2.adobe.com/cps/155/tn_15507.html ]

Modify the “mm.cfg” file to include the following


ErrorReportingEnable=1
TraceOutputFileEnable=1

Now run the Flex/Air application on the same machine on which you have made the changes to “mm.cfg” file

You would find the errors in the log created at

C:\Users\<username>\AppData\Roaming\Macromedia\Flash Player\Logs\flashlog.txt

A complete list of the locations for different OS can be found at refer :

http://help.adobe.com/en_US/flex/using/WSda78ed3a750d6b8f-4867184d1239f9d0558-8000.html

Additional Information

Client-Side Logging

http://help.adobe.com/en_US/LiveCycleDataServicesES/3.1/Developing/WSc3ff6d0ea77859461172e0811f00f6f9ad-7fffUpdate.html

Server-Side Logging

http://help.adobe.com/en_US/LiveCycleDataServicesES/3.1/Developing/WSc3ff6d0ea77859461172e0811f00f7045b-7f42Update.html

Exporting Flex chart Component to Excel as image

Issue

Exporting Flex chart Component to Excel as image

Solution :

        

  • Create a chart component

 

  • Use the method ImageSnapshot .captureImage() to capture snapshot of any component.

please refer : http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/graphics/ImageSnapshot.html#captureImage%28%29 as in the code, var ImageBA:ByteArray = ImageSnapshot.captureImage( Chart, 0, new JPEGEncoder() ).data;

Store the same on a byte array and forward the same to a ColdFusion component as an argument.
 Remote Object call would look like :
        <s:RemoteObject id="RemoteCall" endpoint="http://localhost:8300/flex2gateway/"
                        destination="ColdFusion" source="ChartToShuyi182703455.CallCFCTest">
            <s:method name="CreateImage"
                      result="onResult(event)"
                      fault="onFault(event)">
            </s:method>
        </s:RemoteObject>

            protected function CreateImage_clickHandler(event:MouseEvent):void
            {
                // TODO Auto-generated method stub
                var ImageBA:ByteArray = ImageSnapshot.captureImage( Chart, 0, new JPEGEncoder() ).data;
                RemoteCall.CreateImage(ImageBA);
            }
<s:Button id="CreateImage" label="CreateImage" click="CreateImage_clickHandler(event)" visible="{SnapshotImage.source != null}"/>

On the ColdFusion Server end

  • Use the binary data from the argument and use CFFile Tag to write the image to a file.
    <cffunction name="CreateImage"
        access="remote"
        output="false" returntype="String" >

        <cfargument name="ImageBA" type="binary" required="true" />
        <cffile action="write" file="#theDir#test.jpg" output="#arguments.ImageBA#" >
        <cfreturn "The Image can be found on server : "&#theDir#>
    </cffunction>
  •  Write the image file to the Excel Spreadsheet using CFspreadsheet

please refer : http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS434C35B0-279B-4051-A61B-D84B5D76189C.html
and SpreadsheetAddImage please refer : http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-688c.html

    <cffunction name="ExportToExcel"
        access="remote"
                output="false" returntype="String" >
        <cfimage name="ComponentImage" source="#theDir#test.jpg" action="read"  />
        <cfscript>
            SpreadSheetObj=spreadsheetNew();
            spreadsheetAddimage(spreadsheetobj,ComponentImage,"jpg","5,5,25,12");
        </cfscript>
        <cfspreadsheet action="write"
                       name="SpreadSheetObj"
                       filename="#theDir#imagesheet.xls" overwrite="true" >
        <cfreturn "The SpreadSheet with Chart Image can be found on server : "&#theDir#>
    </cffunction>

Additional Information :

Adobe Products used SDK 4.5.1 and ColdFusion 9.0

 

Flex Code [ChartToExcelAsImage.mxml]:

 

 <?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"  
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">

    <fx:Declarations>
        <s:RemoteObject id="RemoteCall" endpoint="http://localhost:8300/flex2gateway/"
                        destination="ColdFusion" source="ChartToShuyi182703455.CallCFCTest">
            <s:method name="CreateImage"
                      result="onResult(event)"
                      fault="onFault(event)">
            </s:method>
            <s:method name="ExportToExcel"
                      result="onResult(event)"
                      fault="onFault(event)">
            </s:method>
            <s:method name="ClearFiles"
                      result="onResult(event)"
                      fault="onFault(event)">
            </s:method>
        </s:RemoteObject>
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.graphics.ImageSnapshot;
            import mx.graphics.codec.JPEGEncoder;
            import mx.rpc.events.FaultEvent;
            import mx.rpc.events.ResultEvent;

            private var SnapShot:ImageSnapshot;
            [Bindable]private var medalsAC:ArrayCollection = new ArrayCollection( [
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 } ]);
            private var snapshot :ImageSnapshot;
            protected function ScreenShot_clickHandler(event:MouseEvent):void
            {
                SnapshotImage.source=ImageSnapshot.captureImage( Chart, 0, new JPEGEncoder() ).data;
                SnapshotImage.width=ChartComponent.width;
                SnapshotImage.height=ChartComponent.height;
                CreateImage.enabled=true;
            }
            public function onResult(event : ResultEvent) : void
            {
                ServerReturn.text=event.result as String;
            }
            public function onFault(event : FaultEvent) : void
            {
                Alert.show(event.fault.message,event.fault.faultCode );
            }

            protected function CreateImage_clickHandler(event:MouseEvent):void
            {
                // TODO Auto-generated method stub
                var ImageBA:ByteArray = ImageSnapshot.captureImage( Chart, 0, new JPEGEncoder() ).data;
                RemoteCall.CreateImage(ImageBA);
                CreateImage.enabled=false;
                ExportToExcel.enabled=true;
                ClearFiles.enabled=false;
            }

            protected function ExportToExcel_clickHandler(event:MouseEvent):void
            {
                // TODO Auto-generated method stub
                RemoteCall.ExportToExcel.send();
                CreateImage.enabled=false;
                ExportToExcel.enabled=false;
                ClearFiles.enabled=true;
            }

            protected function ClearFiles_clickHandler(event:MouseEvent):void
            {
                // TODO Auto-generated method stub
                RemoteCall.ClearFiles.send();
                CreateImage.enabled=false;
                ExportToExcel.enabled=false;
                ClearFiles.enabled=false;
            }

        ]]>
    </fx:Script>

    <s:layout>
        <s:VerticalLayout verticalAlign="middle" horizontalAlign="center" />
    </s:layout>

    <s:Panel title="BarChart Control"
             color="0x000000"
             borderAlpha="0.15" width="100%">

        <s:layout>
            <s:HorizontalLayout />
        </s:layout>
        <mx:HDividedBox width="100%">

            <s:Panel id="ChartComponent" title="Chart Component" >
                <s:layout>
                    <s:HorizontalLayout/>
                </s:layout>
                <mx:HBox id="Chart" backgroundColor="white">
                    <mx:BarChart id="bar" height="100%" color="0x323232"
                                 showDataTips="true" dataProvider="{medalsAC}">

                        <mx:verticalAxis>
                            <mx:CategoryAxis categoryField="Country"/>
                        </mx:verticalAxis>

                        <mx:series>
                            <mx:BarSeries yField="Country" xField="Gold" displayName="Gold"/>
                            <mx:BarSeries yField="Country" xField="Silver" displayName="Silver"/>
                            <mx:BarSeries yField="Country" xField="Bronze" displayName="Bronze"/>
                        </mx:series>
                    </mx:BarChart>

                    <mx:Legend dataProvider="{bar}" color="0x323232"/>
                </mx:HBox>
            </s:Panel>
            <s:Panel title="Screen Shot">
                <s:Image id="SnapshotImage" width="{ChartComponent.width}" height="{ChartComponent.height}"/>
            </s:Panel>        
        </mx:HDividedBox>

    </s:Panel>
    <s:Panel minWidth="600" minHeight="150">
        <s:layout>
            <s:VerticalLayout verticalAlign="middle" horizontalAlign="center"/>
        </s:layout>
        <s:Button id="ScreenShot" label="Take ScreenShot" click="ScreenShot_clickHandler(event)"/>
        <mx:Text id="ServerReturn" text="no data from server"/>
        <s:Button id="CreateImage" label="CreateImage" click="CreateImage_clickHandler(event)" visible="{SnapshotImage.source != null}"/>
        <s:Button id="ExportToExcel" label="ExportToExcel" click="ExportToExcel_clickHandler(event)" enabled="false" />
        <s:Button id="ClearFiles" label="ExportToExcel" click="ClearFiles_clickHandler(event)" enabled="false" />
    </s:Panel>
</s:Application>

ColdFusion Code :[CallCFCTest.cfc]

 

<cfcomponent displayname="CallCFCTest">
        <cfscript>
            theDir=getDirectoryFromPath(GetCurrentTemplatePath());
        </cfscript>
    <cffunction name="CreateImage"
        access="remote"
        output="false" returntype="String" >

        <cfargument name="ImageBA" type="binary" required="true" />
        <cffile action="write" file="#theDir#test.jpg" output="#arguments.ImageBA#" >
        <cfreturn "The Image can be found on server : "&#theDir#>
    </cffunction>

    <cffunction name="ExportToExcel"
        access="remote"
                output="false" returntype="String" >
        <cfimage name="ComponentImage" source="#theDir#test.jpg" action="read"  />
        <cfscript>
            SpreadSheetObj=spreadsheetNew();
            spreadsheetAddimage(spreadsheetobj,ComponentImage,"jpg","5,5,25,12");
        </cfscript>
        <cfspreadsheet action="write"
                       name="SpreadSheetObj"
                       filename="#theDir#imagesheet.xls" overwrite="true" >
        <cfreturn "The SpreadSheet with Chart Image can be found on server : "&#theDir#>
    </cffunction>
    <cffunction name="ClearFiles"
        access="remote"
                output="false" returntype="String" >

        <cffile action="delete" file="#theDir#test.jpg">
        <cffile action="delete" file="#theDir#imagesheet.xls">
        <cfreturn "The SpreadSheet along with Chart Image have been deleted from Server: "&#theDir#>
    </cffunction>
</cfcomponent>

How make MX DataGrid Cell components i.e. ItemRenderers Automation Friendly

Issue :

How make MX DataGrid Cell components i.e. Custom ItemRenderers Automation Friendly

Solution :

Developers tend to modify the components that usually make up the default cell [ ItemRenderer=cell ] of a Data Grid, to fullfill there business requirements.
A Default cell of a DataGrid is made up of a ‘UITextField’ which is nothing but Text and no other component associated with it and shows up as ‘FlexListLabel’ when recognized with QTP,


modifications may include adding buttons, link buttons, more text, Text Area etc
but if you don’t add them correctly, the components under the Data Grid which are inside the custom item renderer would not be exposed to Automation.

One of the ways to ensure that all components inside your DataGrid cell remain exposed to automation is as follows,

Please find the sample application below “DataGridLinkedButton.mxml”

Your developers need to define inline or External Item renderers for your Data Grid,

based on a Flex container [in the example we have used “HBox”] which exposes its children automatically to automation [you can use HBox or VBox ].

 

For Inline Item renderer :

<mx:DataGridColumn headerText="Inline Renderer" width="150">
<mx:itemRenderer>
<fx:Component>
<mx:HBox horizontalAlign="center">
<mx:LinkButton label="TestLinkButton" color="haloblue" rollOverColor="haloSilver"/>
</mx:HBox>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>

 

For External Item Renderer [ refer : “myExternalItemRenderer.mxml “]

<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
focusEnabled="true" horizontalAlign="center">
<mx:LinkButton label="LinkButton from External Renderer" color="haloblue" rollOverColor="haloSilver"/>
</mx:HBox>

 

Please refer the Image :

Click operations on

1st ,2nd ,3rd ,

4th column [contains External Item Renderer with LinkButton]

and 5th column [contains Inline Item Renderer with LinkButton]

Would record Automation scripts like so.

 

Automation Scripts :

Browser(“Browser”).SparkApplication(“DataGridLinkedButtonQualcomm18″).SparkPanel(“DataGrid Control”).FlexDataGrid(“dg”).Select “*Christina Coenraets* | 555-219-2270 | ccoenraets@fictitious.com | LinkButton from External Renderer | TestLinkButton”

Browser(“Browser”).SparkApplication(“DataGridLinkedButtonQualcomm18″).SparkPanel(“DataGrid Control”).FlexDataGrid(“dg”).Select “Christina Coenraets | *555-219-2270* | ccoenraets@fictitious.com | LinkButton from External Renderer | TestLinkButton”

Browser(“Browser”).SparkApplication(“DataGridLinkedButtonQualcomm18″).SparkPanel(“DataGrid Control”).FlexDataGrid(“dg”).Select “Christina Coenraets | 555-219-2270 | *ccoenraets@fictitious.com* | LinkButton from External Renderer | TestLinkButton”

Browser(“Browser”).SparkApplication(“DataGridLinkedButtonQualcomm18″).SparkPanel(“DataGrid Control”).FlexDataGrid(“dg”).FlexButton(“LinkButton from External”).Click

Browser(“Browser”).SparkApplication(“DataGridLinkedButtonQualcomm18″).SparkPanel(“DataGrid Control”).FlexDataGrid(“dg”).FlexButton(“TestLinkButton”).Click

Additional Information :

Input Operation on FlexAdvancedDataGrid Cell using QTP

 

FLEX CODE

DataGridLinkedButton.mxml

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">

        <fx:Declarations>
            <fx:XMLList id="employees">
                <employee>
                    <name>Christina Coenraets</name>
                    <phone>555-219-2270</phone>
                    <email>ccoenraets@fictitious.com</email>
                    <active>true</active>
                    <image>images/arrow_icon_sm.png</image>
                </employee>
                <employee>
                    <name>Joanne Wall</name>
                    <phone>555-219-2012</phone>
                    <email>jwall@fictitious.com</email>
                    <active>true</active>
                </employee>
                <employee>
                    <name>Maurice Smith</name>
                    <phone>555-219-2012</phone>
                    <email>maurice@fictitious.com</email>
                    <active>false</active>
                </employee>
                <employee>
                    <name>Mary Jones</name>
                    <phone>555-219-2000</phone>
                    <email>mjones@fictitious.com</email>
                    <active>true</active>
                </employee>
            </fx:XMLList>
        </fx:Declarations>

        <s:layout>
            <s:HorizontalLayout horizontalAlign="center" />
        </s:layout>

        <s:Panel title="DataGrid Control"
                 color="0x000000"
                 borderAlpha="0.15">

            <s:layout>
                <s:VerticalLayout paddingLeft="10" paddingRight="10" paddingTop="10" paddingBottom="10"/>
            </s:layout>

            <s:Label width="100%" color="0x323232"
                     text="Select a row in the DataGrid control."/>

            <mx:DataGrid id="dg" color="0x323232" width="100%" rowCount="3" dataProvider="{employees}">
                <mx:columns>
                    <mx:DataGridColumn dataField="name" headerText="Name"/>
                    <mx:DataGridColumn dataField="phone" headerText="Phone"/>
                    <mx:DataGridColumn dataField="email" headerText="Email"/>
                    <mx:DataGridColumn headerText="External Renderer" itemRenderer="myExternalItemRenderer" width="250"/>
                    <mx:DataGridColumn headerText="Inline Renderer" width="150">
                        <mx:itemRenderer>
                            <fx:Component>
                                <mx:HBox horizontalAlign="center">
                                    <mx:LinkButton label="TestLinkButton" color="haloblue" rollOverColor="haloSilver"/>
                                </mx:HBox>
                            </fx:Component>
                        </mx:itemRenderer>
                    </mx:DataGridColumn>
                </mx:columns>
            </mx:DataGrid>

            <mx:Form color="0x323232" width="100%" height="100%" paddingTop="0" paddingBottom="0"  >

                <mx:FormItem label="Name" paddingTop="0" paddingBottom="0">
                    <s:Label text="{dg.selectedItem.name}"/>
                </mx:FormItem>
                <mx:FormItem label="Email" paddingTop="0" paddingBottom="0">
                    <s:Label text="{dg.selectedItem.email}"/>
                </mx:FormItem>
                <mx:FormItem label="Phone" paddingTop="0" paddingBottom="0">
                    <s:Label text="{dg.selectedItem.phone}"/>
                </mx:FormItem>

            </mx:Form>

        </s:Panel>

</s:Application>

 

myExternalItemRenderer.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:fx="http://ns.adobe.com/mxml/2009"
                          xmlns:s="library://ns.adobe.com/flex/spark"
                          xmlns:mx="library://ns.adobe.com/flex/mx"
                          focusEnabled="true" horizontalAlign="center">
    <mx:LinkButton label="LinkButton from External Renderer" color="haloblue" rollOverColor="haloSilver"/>
</mx:HBox>

Flex applications show up as Macromedia Flash objects on QTP Object Spy

Issue :

Flex applications show up as Macromedia Flash objects on QTP Object Spy

Potential Causes :

Ensure the your environment works on Automation enabled build from Adobe, Please refer : http://www.adobe.com/devnet/flex/samples/flex_store_v2.html

  • If the app does not work,the possible causes are

-Issues with compatibility of QTP-Browser-Flex Plugin/Addin
-The Communication between ActiveX Plugin in the browser for Flex-QTP Automaiton Plugin and QTP is interrupted due to Browser Security settings.

  • If the app works then the issue in your environment but your application, the possible causes are

-Application is not compiled with automation swc files i.e. Flex Automation libraries.

Solution :

Issues with compatibility of QTP-Browser-Flex Plugin/Addin

Please refer : http://blogs.adobe.com/vikaschandran/2010/07/10/compatibility-matrix-for-flex-qtp-plugin-3-0-0-and-4-0-0-for-qtp-and-ie-combinations/

 

Application is compiled with automation swc files i.e. Flex Automation libraries.

Please refer :

Compiling Flex 3 Applications to enable automation

http://blogs.adobe.com/vikaschandran/2010/07/11/compiling-flex-3-applications-to-enable-automaiton/

Compiling Flex 4 Applications to enable automation

http://blogs.adobe.com/vikaschandran/2010/07/15/compiling-flex-4-applications-to-enable-automaiton/

 

The Communication between ActiveX Plugin in the browser for Flex-QTP Automation Plugin and QTP is interrupted due to Browser Security settings

This can be avoided by ensuring the following

-the TEAPluginIE.dll which is used by IE ActiveX for the Flex-QTP plug-in loads in Internet explorer when QTP is recording

Because if it’s not loaded in IE nothing would work, Process Explorer should help you check the same.

-the behavior of the Object Spy changes [win objects start showing up] if you change i.e. increase the security properties on the browser for internet and intranet

-if you keep both internet and intranet security to medium or low

i.e. basically allowing the Flex-QTP ActiveX component to do its job without hindrance. Everything would work fine.

Debugging checking and tracking variables in QTP with Flex-QTP Addin

ISSUE

Debugging and tracking variables in QTP

SOLUTION

Have a look at QTP  break point options in the image below

the red dots you see in QTP in the image below are the Break points

 

-right click on the Breakpoint to see the options,

-Use “Run from Step” and “Run to step”

 

Or Use “Debug from Step”

To add the variables to debug viewer you need to add watch on them use “Add to watch”

and check the “Debug viewer” panel to have look at the variables,

 

And once the playback starts use “F10” and “F11” to step through the Automation Scripts line by line

keep an eye on the “Object Repository

To check on the values,

You may also use the following code

myvariable=Browser(“Browser”).SparkApplication(“ADGFidelity182547968Nikhil”).SparkPanel(“AdvancedDataGrid Control”).FlexAdvancedDataGrid(“myADG”).GetROProperty(“automationname”)

print myvariable               //myADG that you see on the image below is the print output

myvariable2=Browser(“Browser”).SparkApplication(“ADGFidelity182547968Nikhil”).SparkPanel(“AdvancedDataGrid Control”).FlexAdvancedDataGrid(“myADG”).GetROProperty(“automationindex”)

msgbox  myvariable2     //index:0 is the msgbox output


Red X instead of image in distributed environment ColdFusion 8 or 9 and IIS : Coldfusion does not serve the Static content by default

ISSUE

Red X instead of image in distributed environment ColdFusion 8 or 9

i.e. when IIS and ColdFusion are on 2 separate physical servers and files [Static content or Dynamic content] does not reside on Web Server but resides on Application server i.e. server machine which has ColdFusion.

SOLUTION [One of the possible solutions]

Basically when it comes to Static content like images,
ColdFusion does not serve the Static content by default

It looks to IIS to serve static content [due to the mapping that are set while configuring the web connector only CFM, CFC, CFR, CFML i.e. ColdFusion specific content would be processed by ColdFusion]

So when you place a request for any content,

by default the request goes to IIS first it checks the extension of the file requested,

if the extension matches the ones which correspond to ColdFusion extensions,

The request is forwarded to ColdFusion to be processed.

 

If not it goes to IIS for processing.

 

Since in certain environments its not possible to keep the files in IIS webroot

And all files are required to be kept at the Application Server Tier/Level.

 

All we need to resolve this issue is to setup the application to use a context root.

So modify the

“Application.xml”

file under location “C:\JRun4\servers\<server instance>\cfusion-ear\META-INF”

 

<web>

<web-uri>cfusion-war</web-uri>

<context-root>/</context-root>

</web>

 

To use an appropriate Context root.

Say

<web>

<web-uri>cfusion-war</web-uri>

<context-root>/Aline</context-root>

</web>

This would force the Application to serve the static content from the Application Server end.

And the control would not go to IIS to serve the static content.

Port number required While configuring the web connector in distributed environment between IIS and Coldfusion 8 or 9

ISSUE

Port number required While configuring the web connector in distributed environment between IIS and Coldfusion 8 or 9

SOLUTION

While configuring the connector using the “Wsconfig” tool in distributed environment between IIS and Coldfusion we need access to 3 port numbers

The Remote port :

At “C:\Jrun4\servers\<serverInstance>\SERVER-INF\jndi.properties”

At line

java.naming.provider.url=localhost:2904

Here 2904 is the remote port.

The Proxy port :

At “C:\Jrun4\servers\<serverInstance>\SERVER-INF\jrun.xml”

<service class=”jrun.servlet.jrpp.JRunProxyService” name=”ProxyService”>

<attribute name=”activeHandlerThreads”>25</attribute>

<attribute name=”backlog”>500</attribute>

<attribute name=”deactivated”>true</attribute>

<attribute name=”interface”>*</attribute>

<attribute name=”maxHandlerThreads”>1000</attribute>

<attribute name=”minHandlerThreads”>1</attribute>

<attribute name=”port”>51020</attribute>

 

Here 51020 is the proxy port

 

And the RMI port [there is no way to determine this port ]: so disable firewall while configuring the connector in distributed architecture,

once the connector is configured re-enable the firewall with exceptions for Proxy port [Mandatory]

ADDITIONAL INFORMATION

If this does not work the only way to configure a connector is

Manual Configuration of Web Connector

please refer : http://www.adobe.com/devnet/coldfusion/articles/iis-configuration.html

Traversing Spark Dropdown list with large number of items Flex SDK 4.x using QTP

ISSUE

Traversing Spark Dropdown list with large number of items Flex SDK 4.x using QTP

SOLUTION

The solution consists of two parts

PART 1

Change the Dropdown code [Application code] to include a property

useVirtualLayout=”false”

[for more details please refer : Using virtualization with list-based controls]


<s:DropDownList id=”DropDownTest” dataProvider=”{arrElementsDdl}” useVirtualLayout=”false” selectedIndex=”0″/>

as in the sample application provided Please refer code below : SparkDropDownFidelity182460106CODE

PART 2

Consists of using the automation Scripts as described below,

‘Get the number of  children under the Drop Down

Browser(“Browser”).SparkApplication(“SparkDropDownFidelity182460106″).SparkDropDownList(“DropDownTest”).Open
Num=Browser(“Browser”).SparkApplication(“SparkDropDownFidelity182460106″).SparkDropDownList(“DropDownTest”).GetItemsCount
Print “‘GetItemsCount’ value for Spark Drop Down: “&Num

‘Loop through the items inside Drop Down using SelectIndex
For i=0 to Num-1
Browser(“Browser”).SparkApplication(“SparkDropDownFidelity182460106″).SparkDropDownList(“DropDownTest”).SelectIndex i

‘Always open the list before checking for the items
Browser(“Browser”).SparkApplication(“SparkDropDownFidelity182460106″).SparkDropDownList(“DropDownTest”).Open
temp=Browser(“Browser”).SparkApplication(“SparkDropDownFidelity182460106″).SparkDropDownList(“DropDownTest”).SparkListLabel(“automationindex:=index:”&i).Exist
print “Object Exists ? : ” &temp
set SparkGetItem=Browser(“Browser”).SparkApplication(“SparkDropDownFidelity182460106″).SparkDropDownList(“DropDownTest”).SparkListLabel(“automationindex:=index:”&i)

‘Access the properties of the item
ItemAutomationname=SparkGetItem.GetROProperty(“automationname”)
ItemAutomationindex=SparkGetItem.GetROProperty(“automationindex”)
print “Spark Automationname : ” & ItemAutomationname&” Automationindex : ” &ItemAutomationindex
Next

ADDITIONAL INFORMATION

SparkDropDownFidelity182460106CODE

<?xml version=”1.0″ encoding=”utf-8″?>
<s:Application xmlns:fx=”http://ns.adobe.com/mxml/2009″
xmlns:s=”library://ns.adobe.com/flex/spark”
xmlns:mx=”library://ns.adobe.com/flex/mx” minWidth=”955″ minHeight=”600″>

<fx:Declarations>
<!– Place non-visual elements (e.g., services, value objects) here –>

</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;

[Bindable]
public var arrElementsDdl:ArrayCollection = new ArrayCollection([
{label:"Item 1", data:1},
{label:"Item 2", data:2},
{label:"Item 3", data:3},
{label:"Item 4", data:4},
{label:"Item 5", data:5},
{label:"Item 6", data:6},
{label:"Item 7", data:7},
{label:"Item 8", data:8},
{label:"Item 9", data:9},
{label:"Item 10", data:10},
{label:"Item 11", data:11},
{label:"Item 12", data:12},
{label:"Item 13", data:13},
{label:"Item 14", data:14},
{label:"Item 15", data:15}]);
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout/>
</s:layout>

<s:ComboBox id=”cboxTest” dataProvider=”{arrElementsDdl}” selectedIndex=”0″ />
<s:DropDownList id=”DropDownTest” dataProvider=”{arrElementsDdl}” useVirtualLayout=”false” selectedIndex=”0″/>
<mx:Text id=”testText” text=”SDK 4.0 test 2 with useVirtualLayout=false”/>
</s:Application>

Running servlets on Coldfusion 9

ISSUE

Running servlets on Coldfusion 9

Continue reading…

Using a Servlet to render a HTML wrapper to call a flex application for automation

ISSUE

Using a servlet to render a HTML wrapper to call a flex application for automation.

SOLUTION

Please find the sample servlet code which is based on the default HTML wrapper generated by Flash Builder.

as long as you have mentioned the right SWF name and compiled the SWF to be automation enabled.

you should be able to record and playback automation scripts.

[ NOTE : Also ensure that you have the related files in place

[ history folder, AC_OETags.js, playerProductInstall.swf, automation enabled application SWF file]

you may find them in any project created from Flash builder (can be found in “Bin-Debug” folder or any release build exported from Flash builder) ]

after adding the files your directory structure would look like this.

 

SERVLET CODE :

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
*
* @author chandran
*/
@WebServlet(name = “QtpServlet”, urlPatterns = {“/QtpServlet”})
public class QtpServlet extends HttpServlet {

/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType(“text/html;charset=UTF-8″);
PrintWriter out = response.getWriter();
try {
/*
out.println(“<html>”);
out.println(“<head>”);
out.println(“<title>Servlet QtpServlet</title>”);
out.println(“</head>”);
out.println(“<body>”);
out.println(“<h1>Servlet QtpServlet at ” + request.getContextPath () + “</h1>”);
out.println(“</body>”);
out.println(“</html>”);
*/

out.println(“<html lang=\”en\”>”);

out.println(“<head>”);
out.println(“<meta http-equiv=\”Content-Type\” content=\”text/html; charset=utf-8\” />”);

/*  BEGIN Browser History required section */
out.println(“<link rel=\”stylesheet\” type=\”text/css\” href=\”history/history.css\” />”);
/*  END Browser History required section */

out.println(“<title></title>”);
out.println(“<script src=\”AC_OETags.js\” language=\”javascript\”></script>”);

/*  BEGIN Browser History required section */
out.println(“<script src=\”history/history.js\” language=\”javascript\”></script>”);
/*  END Browser History required section */

out.println(“<style>”);
out.println(“body { margin: 0px; overflow:hidden }”);
out.println(“</style>”);
out.println(“<script language=\”JavaScript\” type=\”text/javascript\”>”);
/*
// —————————————————————————–
// Globals
// Major version of Flash required*/
out.println(“var requiredMajorVersion = 9;”);
// Minor version of Flash required
out.println(“var requiredMinorVersion = 0;”);
// Minor version of Flash required
out.println(“var requiredRevision = 124;”);
// —————————————————————————–
// */
out.println(“</script>”);
out.println(“</head>”);

out.println(“<body scroll=\”no\”>”);
out.println(“<script language=\”JavaScript\” type=\”text/javascript\”>”);
/*
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)*/
out.println(“var hasProductInstall = DetectFlashVer(6, 0, 65);”);

// Version check based upon the values defined in globals
out.println(“var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);”);

out.println(“if ( hasProductInstall && !hasRequestedVersion ) {“);

// DO NOT MODIFY THE FOLLOWING FOUR LINES
// Location visited after installation is complete if installation is required
out.println(“var MMPlayerType = (isIE == true) ? \”ActiveX\” : \”PlugIn\”;”);
out.println(“var MMredirectURL = window.location;”);

out.println(“document.title = document.title.slice(0, 47) + \” – Flash Player Installation\”;”);
out.println(“var MMdoctitle = document.title;”);

out.println(“AC_FL_RunContent(“);
out.println(“\”src\”, \”playerProductInstall\”,”);
out.println(“\”FlashVars\”, \”MMredirectURL=\”+MMredirectURL+\’&MMplayerType=\’+MMPlayerType+\’&MMdoctitle=\’+MMdoctitle+\”\”,”);
out.println(“\”width\”, \”100%\”,”);
out.println(“\”height\”, \”100%\”,”);
out.println(“\”align\”, \”middle\”,”);
out.println(“\”id\”, \”AccordianHeader182345208\”,”);
out.println(“\”quality\”, \”high\”,”);
out.println(“\”bgcolor\”, \”#ffffff\”,”);
out.println(“\”name\”, \”AccordianHeader182345208\”,”);
out.println(“\”allowScriptAccess\”,\”sameDomain\”,”);
out.println(“\”type\”, \”application/x-shockwave-flash\”,”);
out.println(“\”pluginspage\”, \”http://www.adobe.com/go/getflashplayer\””);
out.println(“);”);
out.println(“} else if (hasRequestedVersion) {“);
// if we\”ve detected an acceptable version
// embed the Flash Content SWF when all tests are passed
out.println(“AC_FL_RunContent(\”src\”, \”AccordianHeader182345208\”,\”width\”, \”100%\”,\”height\”, \”100%\”,\”align\”, \”middle\”,\”id\”, \”AccordianHeader182345208\”,\”quality\”, \”high\”,\”bgcolor\”, \”#ffffff\”,\”name\”, \”AccordianHeader182345208\”,\”allowScriptAccess\”,\”sameDomain\”,\”type\”, \”application/x-shockwave-flash\”,\”pluginspage\”, \”http://www.adobe.com/go/getflashplayer\”);”);
out.println(“} else {  // flash is too old or we can’t detect the plugin”);
out.println(“var alternateContent = \’Alternate HTML content should be placed here. \’+ \’This content requires the Adobe Flash Player. \’+ \’<a href=http://www.adobe.com/go/getflash/>Get Flash</a>\’;document.write(alternateContent);”);
// insert non-flash content
out.println(“}”);
// */
out.println(“</script>”);
out.println(“<noscript>”);
out.println(“<object classid=\”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\””);
out.println(“id=\”AccordianHeader182345208\” width=\”100%\” height=\”100%\””);
out.println(“codebase=\”http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab\”>”);
out.println(“<param name=\”movie\” value=\”AccordianHeader182345208.swf\” />”);
out.println(“<param name=\”quality\” value=\”high />”);
out.println(“<param name=\”bgcolor\” value=\”#ffffff />”);
out.println(“<param name=\”allowScriptAccess\” value=\”sameDomain\” />”);
out.println(“<embed src=\”AccordianHeader182345208.swf\” quality=\”high\” bgcolor=\”#ffffff\””);
out.println(“width=\”100%\” height=\”100%\” name=\”AccordianHeader182345208\” align=\”middle\””);
out.println(“play=\”true\””);
out.println(“loop=\”false\””);
out.println(“quality=\”high\””);
out.println(“allowScriptAccess=\”sameDomain\””);
out.println(“type=\”application/x-shockwave-flash\””);
out.println(“pluginspage=\”http://www.adobe.com/go/getflashplayer\”>”);
out.println(“</embed>”);
out.println(“</object>”);
out.println(“</noscript>”);
out.println(“</body>”);
out.println(“</html>”);

} finally {
out.close();
}
}

// <editor-fold defaultstate=”collapsed” desc=”HttpServlet methods. Click on the + sign on the left to edit the code.”>
/**
* Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}

/**
* Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}

/**
* Returns a short description of the servlet.
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return “Short description”;
}// </editor-fold>
}

QTP Visibility issue with Flex objects ? [visible=false or .exist does not work as expected]

ISSUE

QTP Visibility issue with Flex objects ? [visible=false or .exist does not work as expected]

SOLUTION

While working with a client on a bug logged : http://bugs.adobe.com/jira/browse/FLEXENT-1283

we came across the following,

With SDK 3.2 and 3.5

 

if we toggle the visibility of a container, you would not get the desired result for automation for children within the container.

-we will get an .exist or getROProperty(“Visible”) to work

only if, not just the container holding the components is set to visible=false but the components inside [children] are set to visible=false explicitly

-we will be able to highlight the components once they are invisible.

Reason being that setting the visibility to false does not remove the component form the display tree hence it would still exist and get highlighted using QTP.

 

This sample application and automation scripts can repro the issue

Please refer “TestVisibility” Code and automation scripts.

 

Kindly try the approach used in the “testFormITemRemoval” application as another work around

which uses Flex States to remove items, this will give you the right results.

i.e.

-we get an .exist or getROProperty(“Visible”) set to False i.e. to work once the items inside the Form item are invisible [Department Form Item is removed using states]

-we cannot highlight the components once they are invisible [ if we try we get the error as seen in the bottom right hand corner of the image below]

the Flex application and code and automation scripts are mentioned below.

Refer :

“testFormITemRemoval” Code and automation scripts

 


“testFormITemRemoval” image


“TestVisibility” image


ADDITIONAL INFORMATION

“testFormITemRemoval” Automation Scripts :

 

test2=Browser(“Browser”).FlexApplication(“VisibilityIssueWachovia1819841″).FlexForm(“loginForm”).FlexRadioButton(“Department:it”).Exist

print “Department IT radio button Exists : “&test2

DepItVisible=Browser(“Browser”).FlexApplication(“VisibilityIssueWachovia1819841″).FlexForm(“loginForm”).FlexRadioButton(“Department:it”).GetROProperty(“visible”)

print “Department IT visible : ” &DepItVisible

 

test3=Browser(“Browser”).FlexApplication(“VisibilityIssueWachovia1819841″).FlexForm(“loginForm”).FlexRadioButton(“Department:accounts”).Exist

print “Department Accounts Radio button Exists : ” &test3

DepAccountVisible=Browser(“Browser”).FlexApplication(“VisibilityIssueWachovia1819841″).FlexForm(“loginForm”).FlexRadioButton(“Department:accounts”).GetROProperty(“visible”)

print “Department Accounts Visible :”&DepAccountVisible

 

test4=Browser(“Browser”).FlexApplication(“VisibilityIssueWachovia1819841″).FlexForm(“loginForm”).FlexTextArea(“Department:departmentid”).Exist

print “Department id TextInput Exists : ” &test4

DepIdTextBoxVisible=Browser(“Browser”).FlexApplication(“VisibilityIssueWachovia1819841″).FlexForm(“loginForm”).FlexTextArea(“Department:departmentid”).GetROProperty(“visible”)

print “Department Accounts Visible :”&DepIdTextBoxVisible

Browser(“Browser”).FlexApplication(“VisibilityIssueWachovia1819841″).FlexForm(“loginForm”).FlexButton(“employeesOnlyButton”).Click

 

Print “AFTER FORM ITEM DEPARTMENT REMOVAL”

 

test2=Browser(“Browser”).FlexApplication(“VisibilityIssueWachovia1819841″).FlexForm(“loginForm”).FlexRadioButton(“Department:it”).Exist(5)

print “Department IT radio button Exists : “&test2

DepItVisible=Browser(“Browser”).FlexApplication(“VisibilityIssueWachovia1819841″).FlexForm(“loginForm”).FlexRadioButton(“Department:it”).GetROProperty(“visible”)

print “Department IT visible : ” &DepItVisible

 

test3=Browser(“Browser”).FlexApplication(“VisibilityIssueWachovia1819841″).FlexForm(“loginForm”).FlexRadioButton(“Department:accounts”).Exist(5)

print “Department Accounts Radio button Exists : ” &test3

DepAccountVisible=Browser(“Browser”).FlexApplication(“VisibilityIssueWachovia1819841″).FlexForm(“loginForm”).FlexRadioButton(“Department:accounts”).GetROProperty(“visible”)

print “Department Accounts Visible :”&DepAccountVisible

 

test4=Browser(“Browser”).FlexApplication(“VisibilityIssueWachovia1819841″).FlexForm(“loginForm”).FlexTextArea(“Department:departmentid”).Exist

print “Department id TextInput Exists : ” &test4

DepIdTextBoxVisible=Browser(“Browser”).FlexApplication(“VisibilityIssueWachovia1819841″).FlexForm(“loginForm”).FlexTextArea(“Department:departmentid”).GetROProperty(“visible”)

print “Department Accounts Visible :”&DepIdTextBoxVisible

 

“testFormITemRemoval” Application Code :

 

<?xml version=”1.0″ encoding=”utf-8″?>

<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”vertical” minWidth=”955″ minHeight=”600″>

<mx:states>

<mx:State name=”hideFormItem”>

<mx:RemoveChild target=”{department}”/>

<mx:RemoveChild target=”{employeesOnlyButton}”/>

</mx:State>

</mx:states>

 

<mx:Form id=”loginForm” automationName=”loginForm”>

<mx:FormItem id=”username” automationName=”username” label=”Username” direction=”horizontal”>

<mx:TextInput id=”usernameInput” automationName=”usernameInput”/>

</mx:FormItem>

<mx:FormItem id=”password” automationName=”password” label=”Password” direction=”horizontal”>

<mx:TextInput id=”passwordInput” automationName=”passwordInput”/>

</mx:FormItem>

<mx:FormItem id=”department” automationName=”department” label=”Department” direction=”vertical”>

<mx:RadioButton id=”it” automationName=”it” label=”IT”/>

<mx:RadioButton id=”accounts” automationName=”accounts” label=”Accounts”/>

<mx:TextInput id=”departmentid” automationName=”departmentid” text=”Enter Department ID”/>

</mx:FormItem>

<mx:FormItem direction=”horizontal”>

<mx:Button id=”loginButton” automationName=”loginButton” label=”Login”/>

<mx:Button id=”employeesOnlyButton” automationName=”employeesOnlyButton” label=”Employees Only” click=”currentState=‘hideFormItem’“/>

</mx:FormItem>

</mx:Form>

</mx:Application>

 

“TestVisibility” Automation Scripts :

 

test2=Browser(“Browser”).FlexApplication(“testVisibility”).FlexForm(“loginForm”).FlexRadioButton(“Department:it”).Exist

print “Department IT radio button Exists : “&test2

DepItVisible=Browser(“Browser”).FlexApplication(“testVisibility”).FlexForm(“loginForm”).FlexRadioButton(“Department:it”).GetROProperty(“visible”)

print “Department IT visible : ” &DepItVisible

 

test3=Browser(“Browser”).FlexApplication(“testVisibility”).FlexForm(“loginForm”).FlexRadioButton(“Department:accounts”).Exist

print “Department Accounts Radio button Exists : ” &test3

DepAccountVisible=Browser(“Browser”).FlexApplication(“testVisibility”).FlexForm(“loginForm”).FlexRadioButton(“Department:accounts”).GetROProperty(“visible”)

print “Department Accounts Visible :”&DepAccountVisible

 

test4=Browser(“Browser”).FlexApplication(“testVisibility”).FlexForm(“loginForm”).FlexTextArea(“Department:departmentid”).Exist

print “Department id TextInput Exists : ” &test4

DepIdTextBoxVisible=Browser(“Browser”).FlexApplication(“testVisibility”).FlexForm(“loginForm”).FlexTextArea(“Department:departmentid”).GetROProperty(“visible”)

print “Department Accounts Visible :”&DepIdTextBoxVisible

 

Browser(“Browser”).FlexApplication(“testVisibility”).FlexForm(“loginForm”).FlexButton(“employeesOnlyButton”).Click

 

Print “AFTER FORM ITEM DEPARTMENT REMOVAL”

 

test2=Browser(“Browser”).FlexApplication(“testVisibility”).FlexForm(“loginForm”).FlexRadioButton(“Department:it”).Exist(5)

print “Department IT radio button Exists : “&test2

DepItVisible=Browser(“Browser”).FlexApplication(“testVisibility”).FlexForm(“loginForm”).FlexRadioButton(“Department:it”).GetROProperty(“visible”)

print “Department IT visible : ” &DepItVisible

 

test3=Browser(“Browser”).FlexApplication(“testVisibility”).FlexForm(“loginForm”).FlexRadioButton(“Department:accounts”).Exist(5)

print “Department Accounts Radio button Exists : ” &test3

DepAccountVisible=Browser(“Browser”).FlexApplication(“testVisibility”).FlexForm(“loginForm”).FlexRadioButton(“Department:accounts”).GetROProperty(“visible”)

print “Department Accounts Visible :”&DepAccountVisible

 

test4=Browser(“Browser”).FlexApplication(“testVisibility”).FlexForm(“loginForm”).FlexTextArea(“Department:departmentid”).Exist

print “Department id TextInput Exists : ” &test4

DepIdTextBoxVisible=Browser(“Browser”).FlexApplication(“testVisibility”).FlexForm(“loginForm”).FlexTextArea(“Department:departmentid”).GetROProperty(“visible”)

print “Department Accounts Visible :”&DepIdTextBoxVisible

 

“TestVisibility” Application Code :

<?xml version=”1.0″ encoding=”utf-8″?>

<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”vertical” minWidth=”955″ minHeight=”600″>

 

<mx:Form id=”loginForm” automationName=”loginForm”>

<mx:FormItem id=”username” automationName=”username” label=”Username” direction=”horizontal”>

<mx:TextInput id=”usernameInput” automationName=”usernameInput”/>

</mx:FormItem>

<mx:FormItem id=”password” automationName=”password” label=”Password” direction=”horizontal”>

<mx:TextInput id=”passwordInput” automationName=”passwordInput”/>

</mx:FormItem>

<mx:FormItem id=”department” automationName=”department” label=”Department” direction=”vertical”>

<mx:RadioButton id=”it” automationName=”it” label=”IT”/>

<mx:RadioButton id=”accounts” automationName=”accounts” label=”Accounts”/>

<mx:TextInput id=”departmentid” automationName=”departmentid” text=”Enter Department ID”/>

</mx:FormItem>

<mx:FormItem direction=”horizontal”>

<mx:Button id=”loginButton” automationName=”loginButton” label=”Login”/>

<mx:Button id=”employeesOnlyButton” automationName=”employeesOnlyButton” label=”Employees Only” click=”{department.visible=false;}”/>

</mx:FormItem>

</mx:Form>

</mx:Application>

ColdFusion 9 Flash forms do not show up/ Load with “Check file exist”/ “Verify that file exists” and NTLM authentication

ISSUE

ColdFusion 9 Flash forms do not show up/ Load with “Check file exist”/ “Verify that file exists” and NTLM authentication [ applies also to Coldfusion 9 Update 1 [ColdFusion 901] ]

SOLUTION

Use the Instructions in the link provided Below,

Configuring IIS 6.0 with NTLM for Adobe Flash forms, please refer : http://kb2.adobe.com/cps/000/ebd0cbe3.html

[NOTE : The purpose of this Post is to inform that the Fix as suggested in link mentioned above still applies to Coldfusion 9 and ColdFusion 9 Update 1[ColdFusion 901] ]

ADDITIONAL INFORMATION

ColdFusion MX 7.0.1 and 7.0.2: Configuring IIS 6.0 with NTLM for Adobe Flash forms
Implementing NT authentication for ColdFusion templates with IIS Web Server (ColdFusion MX & ColdFusion 8)

 

Traversing items in a Flex 4 Spark Combobox using QTP

ISSUE

Traversing items in a Flex 4 Spark Combobox using QTP

SOLUTION :

Use the following Automation scripts :

‘Get the number of automation children

Browser(“Browser”).SparkApplication(“Ananada182244668SparkComboboxT”).SparkPanel(“Spark Combobox”).SparkComboBox(“testSparkCombobox”).Open
Num=Browser(“Browser”).SparkApplication(“Ananada182244668SparkComboboxT”).SparkPanel(“Spark Combobox”).SparkComboBox(“testSparkCombobox”).GetROProperty(“numautomationchildren”)
Print “‘numautomationchildren’ value for Spark Combobox : “&Num

‘Loop through them

For i=0 to Num-1

‘Select the node inside the combobox by using GetAutomationChildAt method
set SparkGetChild=Browser(“Browser”).SparkApplication(“Ananada182244668SparkComboboxT”).SparkPanel(“Spark Combobox”).SparkComboBox(“testSparkCombobox”).GetAutomationChildAt(i)

‘Access the properties of the node specified above using GetROProperty
SparkAutomationname=SparkGetChild.GetROProperty(“automationname”)
SparkAutomationindex=SparkGetChild.GetROProperty(“automationindex”)
print “Spark Automationname : ” & SparkAutomationname &” Automationindex : ” &SparkAutomationindex

Next

Additional Information :

Traversing items in a Flex 3 [Halo] Combobox using QTP

Traversing through a Flex 3 or 4 Advanced Data grid using QTP

Input Operation on FlexAdvancedDataGrid Cell using QTP

http://bugs.adobe.com/jira/browse/FLEXENT-1347

Creating Oracle Datasource with ODBC Socket on Coldfusion 9 32 bit on Windows 64 bit platform

ISSUE

Creating Oracle Datasource with ODBC Socket on Coldfusion 9 32 bit on Windows 64 bit platform

SOLUTION

-Create a System DSN using the “ODBC Datasource Administrator”
at location “c:\Windows\SysWOW64\odbcad32.exe”

[note : There are two ODBC Datasource Administrators one contains 32 bit drivers and the other has 64 bit,

so make sure you are selecting the file from the right location]

-Once the System DSN is created Test connection to check connectivity.
-Restart the server [Important]

-Create a Datasource in the Coldfusion administrator console, Select “ODBC Socket” for Driver
-Select the System DSN you created for “ODBC DSN”, Username and password
-Hit “Submit”

That would create your ODBC Oracle DataSource.

Enabling Automation for Air Applications

ISSUE :

Enabling Automation for Air Applications

 

SOLUTION :

Support for AIR automation has been added in Flex-QTP Plugin 4.0.0

the automation swcs [libraries] required for AIR automation are only available in Flex SDK 4.0 onwards for AIR.

All Air Versions shipped SDK 4.0 onwards are supported by the Flex-QTP Plugin 4.0.0

 

Environment Requirements for Using the QTP Plug-in 4.0.0

 

    1. Make sure the environment conforms to,https://www.adobe.com/devnet/flex/pdfs/flex4_plug-in_hp_quicktest_professional.pdf
    2. The QTP plug-in is installed and appears in the plugin section when QTP is started.[Flex-QTP Plugin 4.0.0 Download]

Note : Do not Delete the Folder containing the .bat file after Installation of the Plug-in,

as the QTP refers to the contents of the folder every time it launches to gather information regarding the plugin.

On the Application End i.e. the AIR Application Build under test [AUT]
You would need to make sure that
1. The AIR application is compiled with Automation SWCs

To compile your applications with static automation support:

1.    Start Flash Builder.
2.    Create a new Flex Project.
3.    Select your new Flex project in the Navigator.
4.    Select Project > Properties > Flex Compiler.
5.    In the “Additional compiler arguments” field, enter the following:
-include-libraries

“Flash_Builder_4_dir\sdks\4.0.0\frameworks\libs\automation\automation.swc”
“Flash_Builder_4_dir\sdks\4.0.0\frameworks\libs\automation\automation_air.swc”
“Flash_Builder_4_dir\sdks\4.0.0\frameworks\libs\automation\automation_airspark.swc”
“Flash_Builder_4_dir\sdks\4.0.0\frameworks\libs\automation\automation_agent.swc”
“Flash_Builder_4_dir\sdks\4.0.0\frameworks\libs\automation\qtp_air.swc”
“Flash_Builder_4_dir\sdks\4.0.0\frameworks\libs\automation\automation_dmv.swc”
“Flash_Builder_4_dir\sdks\4.0.0\frameworks\libs\automation\automation_spark.swc”
“Flash_Builder_4_dir\sdks\4.0.0\frameworks\libs\automation\automation_flashflexkit.swc”

The -include-libraries compiler option is relative to the Flex Builder installation directory; the default on Windows is ” C:\Program Files\Adobe\Adobe Flash Builder 4”

2.  Application is compiled with a valid Flash builder Premium license.

Or else your test scripts would be limited to 30 actions.
If you exceed 30 actions in a test without the Premium license, you will receive a warning that your license is not present.

As long as the this criteria is met,
and the Flex QTP plugin is installed.
You should be able to record QTP scripts against Flex Applications.

Additional information :

 

Using bind on Cfgrid to call cfc

Issue :

using bind on Cfgrid to call cfc

 

Solution :

Using the following code :

 

CFM :

<html>
<body>
<cfform>

<cfgrid name = "FirstGrid" width = "500"
 colheaderbold="Yes" format="html"
 bind="cfc:components.bindCfc.getdata({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},
{cfgridsortdirection})">
 <cfgridcolumn name = "FIRSTNAME" header="FIRST NAME">
 <cfgridcolumn name = "LASTNAME" header="LAST NAME">
 <cfgridcolumn name = "EMAIL" header="EMAIL">
</cfgrid>

</cfform>
</body>
</html>

CFC :

<cfcomponent>

 <cffunction name="getdata" access="remote">
 <cfargument name="page">
 <cfargument name="pageSize">
 <cfargument name="gridsortcolumn">
 <cfargument name="gridsortdir">

 <cfquery name="empQuery" datasource="cfdocexamples" >
 SELECT FIRSTNAME, LASTNAME, EMAIL
 FROM tblEmployees
 </cfquery>

 <cfset result = queryConvertForGrid(duplicate(empQuery), arguments.page, arguments.pagesize)>
 <cfreturn result>

 </cffunction>
</cfcomponent>

Continue reading…

Migration from Coldfusion 8 Enterprise to Coldfusion 801 Enterprise

ISSUE

Migration from Coldfusion 8 Enterprise to Coldfusion 801 Enterprise

 

SOLUTION

Approach to be used :

-Create the CAR file, to back up the settings on the current server.

Please refer : http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=deploying_3.html#119982

-Uninstall ColdFusion 8

-Hard Reboot the Machine.

-Clean any residue Coldfusion Specific files from

1. The installation directory of Coldfusion

2. The WebSever document root [CFIDE folder only if it exists]

-Install ColdFusion 801

-Use the CAR file to restore the Data sources.

 

Additional Resources :

Packaging applications in CAR files

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=deploying_3.html#119982

“Unable to find AutomationClass” Error solution for SDK 4.1 Flex-QTP

ISSUE

Flex Applications once compiled with automation SWC files from SDK 4.1 to enable automation for testing with QTP plugin.

throws RTE [Runtime Exception] with DataGrids, Combobox, DropDownList etc…

like so,

Every click on the Data Grid cells throws RTE

Error: Unable to find AutomationClass for ‘mx.controls.DataGrid’ ‘Insight_DataGrid0.Panel4.dg’.
at mx.automation.qtp::QTPEnvironment/getAutomationClassByInstance()[C:\work\flex\dmv_automation\projects\qtp\src\mx\automation\qtp\QTPEnvironment.as:204]
at mx.automation.delegates.controls::ListBaseAutomationImpl/recordListItemSelectEvent()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\delegates\controls\ListBaseAutomationImpl.as:175]
at mx.automation.delegates.controls::ListBaseAutomationImpl/mouseClickHandler()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\delegates\controls\ListBaseAutomationImpl.as:586]
Every Selection of item on the DropDownList throws RTE

Error: Unable to find AutomationClass for ‘spark.components.DataGroup’ ‘dropDown.scroller.ScrollerSkin91.dataGroup’.
at mx.automation.qtp::QTPEnvironment/getAutomationClassByInstance()[C:\work\flex\dmv_automation\projects\qtp\src\mx\automation\qtp\QTPEnvironment.as:203]
at spark.automation.delegates.components::SparkDataGroupAutomationImpl/recordDataGroupItemClickEvent()[E:\dev\4.x\frameworks\projects\automation_spark\src\spark\automation\delegates\components\SparkDataGroupAutomationImpl.as:229]
at spark.automation.delegates.components::SparkDataGroupAutomationImpl/mouseDownHandler()[E:\dev\4.x\frameworks\projects\automation_spark\src\spark\automation\delegates\components\SparkDataGroupAutomationImpl.as:208]

SOLUTION

All these issues have been resolved in SDK 4.5

which can be downloaded from refer:http://opensource.adobe.com/wiki/display/flexsdk/Hero

ADDITIONAL INFORMATION

BUGS LOGGED :

Click on DropDownList in SDK 4.1 errors with RTE Unable to find AutomationClass for ‘spark.components.DataGroup’ ‘dropDown.scroller.ScrollerSkin91.dataGroup’.

https://bugs.adobe.com/jira/browse/FLEXENT-1397

Error: Unable to find AutomationClass for ‘mx.controls.DataGrid’ on click on datagrid cell compiled with SDK 3.5 and automation swcs

https://bugs.adobe.com/jira/browse/FLEXENT-1319

Traversing items in a Flex 3 [Halo] Combobox using QTP

ISSUE

Traversing items in a Flex 3 [Halo] Combobox using QTP

SOLUTION :

Use the following Automation scripts :

‘Get the number of automation children

num=Browser(“Browser”).FlexApplication(“ComboboxNomura181990708″).FlexPanel(“testComboBox”).FlexComboBox(“ComboBox1″).GetROProperty (“numautomationchildren”)
print “Number of Automation Children :”&num

‘Loop through them

For i=0 to num-1

‘Select the node inside the combobox by using GetAutomationChildAt method
set getNode=Browser(“Browser”).FlexApplication(“ComboboxNomura181990708″).FlexPanel(“testComboBox”).FlexComboBox(“ComboBox1″).GetAutomationChildAt(i)

‘Access the properties of the node specified above using GetROProperty
getautomationname=getNode.GetROProperty(“automationname”)
getautomationindex=getNode.GetROProperty(“automationindex”)
print “AutomationIndex : “&getautomationindex  &”  AutomationName : “&getautomationname
Next

Additional Information :

Traversing items in a Flex 4 Spark Combobox using QTP

Traversing through a Flex 3 or 4 Advanced Data grid using QTP

Input Operation on FlexAdvancedDataGrid Cell using QTP