Monday 22 December 2014

Object Recognition with Flex Add-in or Getting ready to work with Flex Add-in Using UFT or QTP

                                        Link to Mandatory QTP /UFT Interview Questions to read before Interview

Object Recognition with Flex Add-in or Getting ready to work with Flex Add-in Using UFT or QTP

 


Requirements


Flex Application Automated Testing and the QTP agent require installing the following:

  • Flash Player ActiveX control, version 9.0.28.0 or higher
  • Microsoft Internet Explorer, version 6 or later
  • Mercury Quick Test Professional 9.2 and patch 1701, Quick Test Professional 9.5 or UFT or Higher version
  • Adobe Flex 3 Plug-in for Mercury Quick Test Pro or higher




Note:- Flex add-in is now directly available with UFT versions and no need for explicit download from Adobe.

Installation

1.     Flex Builder 3 professional and the QTP add-in will be present in the path <Drive>\Program Files\Adobe\Flex Builder 3\Installers\

2.     QTP_Plugin_Installer.exe Run this exe file and this will install the Add-in.

Note:-

For Add-in installation we can copy only the add-in and install it is not necessary to install Flex Builder 3 professional.

Verification

1.     GO to registry and verify the following dll’s is present
  • TEAPluginIE.dll
  • TEAPluginQTP.dll
Note:-   If this dll’s are Registry is not present then it means that the Add-in is not installed properly.

2.    Test the Flash player version, the following link will test flash player version in your browser: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_15507

3.     Verify TEAFlexAgentIE Class is present in the IE Add-ons.


4.     Verify after installation the Flex Add-in is present as shown in the below Snapshot.


Setting applications for testing or Flex Project


We have to pre-compile the test application has the functional testing classes are embedded in the application at compile time, and the application has no external dependencies for automated testing at run time. The below are steps to configure the application for automation testing.

 1.     Start Flex Builder.

2.     Create a new Flex Project.

3.     Select your new Flex project in the Navigator.

4. Flex Build Path

1.     Right Click on the Project. and Select Properties
2.     Select “Flex Build Path” from the Left panel List.
3.     Click on the Library Path Tab in the Right panel.

 This is the list of Libraries to be added while compiling the project

1.     automation.swc
2.     automation_agent.swc
3.     automation_dmv.swc
4.     automation_flashflexkit.swc
5.     qtp.swc



Note:-

If the Library is not added into the project Use “Add SWC” button to add the reference into the exist project to be complied. Path: - “<Installation Drive>\Program Files\Adobe\Flex Builder 3\sdks\3.1.0\frameworks\libs”

**<Installation Drive>= C: or D: Drive

5. Flex Compiler

1.     Right Click on the Project and Select properties.
2.     Select “Flex Complier” from the Left panel List
3.     Verify/ Add Additional Complier Arguments is set a s shown in the below 





-include-libraries "C:\Program Files\Adobe\Flex Builder 3\sdks\3.1.0\frameworks\libs\automation.swc" "C:\Program Files\Adobe\Flex Builder 3\sdks\3.1.0\frameworks\libs\automation_agent.swc" "C:\Program Files\Adobe\Flex Builder 3\sdks\3.1.0\frameworks\libs\qtp.swc" "C:\Program Files\Adobe\Flex Builder 3\sdks\3.1.0\frameworks\libs\automation_dmv.swc"
 

4.         Click the OK button to save your changes and OK to close the project Properties dialog box.

5.         Compile your Flex application.

Note:-

When the Project is Compiled/Built with all above specified settings, it helps the QTP Flex Agents to recognize the Flex Test objects and differentiate into proper Flex class 

Adobe Flash CS3


Automation of the Flash CS3 is done with help of Adobe Flex Component Kit

When Flex controls, containers, skins, and other assets is created using Flash CS3 Professional and import those assets into our Flex application, we need to include the automation_flashflexkit.swc library.

If we are using run-time loading, re-compile the runtimeloading.swf file by using the build.bat file in flex_builder_root\sdks\3.0.0\templates\automation-runtimeloading-files\. The build.bat batch file includes the necessary libraries.

Advantage 

  1. We will be able to record the actions performed on the Flex Controls.
  2. Objects are recognized based on there Standard flex classes.
  3. We will be able to retrieve the Run time value from the Controls.
  4. We will be able to use the descriptive programming for automation testing with QTP
  5. We can Replay the test scripted/ recorded on the test application.

Limitation/Disadvantages








  1. When we embed functional testing classes in our test application SWF file at compile time, the SWF file size increases.
  2. As the size of the SWF file increases then the download time of the SWF file will increase and involve some performance issue. 
  3. Due to the size issue we may require 2 SWF files. One file with functional testing classes embedded and one without for functional testing and deployment.
  4. QTP 9.1 does not support Smart Identification when working with Flex add-ins
  5. Currently Flex Add-in for QTP 9.5 does not support the Record or relay on IE 7, Fire Fox or Netscape.
  6. The object identification property will not work with Flex controls
  7. With currently downloaded version of QTP Flex Add-in only 30 actions can be performed on the test application after which licensing message box appears and will not be able to continue.

QTP Recorded Script

The below is the script Generated for the above Test flex Application. We were successfully able to perform the required actions for the test Application. The script for the same can be seen the below snapshot.
We are also able to work with the flex object with descriptive programming.


QTP Recorded Actions Performed on flex Action

                                        Link to Mandatory QTP /UFT Interview Questions to read before Interview

2 comments:

  1. Adobe Flex |Training|Job Support|Corporate|+91-741-626-7887 Flex 4 and LiveCycle Data Services|Adobe Product Training |AIR 2 and Flex 4 |Job Support at Layman Learning www.laymanlearning.com --- Send Enquiry --- hr@laymanlearning.com

    ReplyDelete
  2. What are the setting required for UFT 12.52 to identify the flash objects?
    Can the objects be identified without installing the Flex automation plug in and Recompiling the Flex Application?

    ReplyDelete