Google ExcelAutomate.com: Test Flex Application Using Rational Functional Tester

Test Flex Application Using Rational Functional Tester

I faced some challenges while automating an application, which is partially flex and html, so in this article I'm going to explain how we can test the flex content using IBM Rational Functional Tester 8.5 or above.

Here you go...!!!
Functional Tester supports testing functional aspects of Adobe® Flex applications. You can record and playback scripts against Flex based user interfaces inside a Web browser and verify that the application functions correctly.
Functional Tester supports testing Flex applications that are built using Flex SDK 2.0.1 or higher. Currently Microsoft® Internet Explorer version 6.0 ,7.0,8.0,9.0 and 10.0 with the ActiveX Flash Player version 9.0.28.0 or later supports functional testing on Flex applications.


Note: Testing Adobe Flex applications is supported only on 32-bit browsers. Testing Flex applications on Mozilla Firefox 17.0 browsers is not supported.


The testing process is based on the tasks Flex developers and testers perform. The process for automating functional tests of Flex applications differs depending on the way developers create the application-under-test.
Automated testing of Flex applications requires you to load supporting files. These supporting files can be loaded in two different stages:
  • At compile-time for applications that are enabled for functional testing
  • At run-time for applications that are not enabled for functional testing

Testing Functional Tester enabled Flex applications

Developers can enable the Flex applications for testing by compiling the Flex application with Functional Tester agent (rft.swc) and Flex automation framework libraries (from flex SDK).
Procedure:
You can use either the IBM Rational Functional Tester Flex user interface or one of the following tools to enable the Flex application:
  • Flex Builder
  • Command-line compiler
 Flex Builder :
  1. Start Flex Builder.
  1. Create a new Flex project.
  1. Select the Flex project in the navigator.
  1. Click Select Project > Properties > Flex Compiler.
  1. Type the following argument in the Additional compiler arguments field:                         -include-libraries+="C:\Program Files(x86)\Adobe\flex_sdk_4.1\frameworks\libs\automation\automation.swc;C:\Program Files (x86)\Adobe\flex_sdk_4.1\frameworks\libs\automation\automation_agent.swc;C:\Program Files (x86)\Adobe\flex_sdk_4.1\frameworks\libs\automation\automation_dmv.swc;C:\Program Files (x86)\Adobe\flex_sdk_4.1\frameworks\libs\automation\automation_monkey4.x.swc;C:\Program Files (x86)\Adobe\flex_sdk_4.1\frameworks\libs\datavisualization.swc;C:\Program Files (x86)\Adobe\flex_sdk_4.1\frameworks\libs\automation\automation_spark.swc;C:\Program Files (x86)\IBM\SDP\FunctionalTester\bin\rftFlex4.0.swc;C:\Program Files (x86)\IBM\SDP\FunctionalTester\bin\rftProp_Flex4.0.swc
(Automation(s) files are available in flex SDK and Functional Tester agent (rftFlexX.0.swc) at C:\Program Files (x86)\IBM\SDP\FunctionalTester\bin)
  1. Click OK to save your changes.
  1. Click OK. The Properties dialog box closes.
  1. Compile your Flex application.
After completing above steps create a file- “Flex” (without extension) in C:\Windows\System32\Macromed\Flash\FlashPlayerTrust (you may require to create FlashPlayerTrust folder) and provide the path of your application under test.

  • Command-line compiler :                                                                                                             Compile the Flex application the following command:  (DateChooserEvent.bat)
 "C:\Program Files (x86)\Adobe\flex_sdk_4.1\bin\mxmlc.exe" -include-libraries+="C:\Program Files (x86)\Adobe\flex_sdk_4.1\frameworks\libs\automation\automation.swc;C:\Program Files (x86)\Adobe\flex_sdk_4.1\frameworks\libs\automation\automation_agent.swc;C:\Program Files (x86)\Adobe\flex_sdk_4.1\frameworks\libs\automation\automation_dmv.swc;C:\Program Files (x86)\Adobe\flex_sdk_4.1\frameworks\libs\automation\automation_monkey4.x.swc;C:\Program Files (x86)\Adobe\flex_sdk_4.1\frameworks\libs\datavisualization.swc;C:\Program Files (x86)\Adobe\flex_sdk_4.1\frameworks\libs\automation\automation_spark.swc;C:\Program Files (x86)\IBM\SDP\FunctionalTester\bin\rftFlex4.0.swc;C:\Program Files (x86)\IBM\SDP\FunctionalTester\bin\rftProp_Flex4.0.swc" -output "C:\TestSparkwithRFT\DateChooserEvent.swf" "C:\TestSparkwithRFT\DateChooserEvent.mxml"



This will result in generation of RFT enabled .swf file with .html
-------------------------------------------------------------------------------------------
Testing Flex Application using RFT v 8.5 screenshots
Step 1: Configure AUT with RFT:
Click Add

Step 2: Select kind of application as flex.
Click Next
Step 3: Select  Configure Flex application setup(if application is running on local host)
Click Next

Step 4: select local host, Flex SDK version. Also provide .mxml file(if application is running using tomcat, please provide .mxml file C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\Sample\<index.mxml>), Also provide location to keep .swf file (usually that will be same.


This will generate .bat file and .html files. (You may require editing .bat file with correct FLEX Automation Libraries path as mention in command-line compiler. Refer fig 8)


Step 5:
Click Finish.
Step 6: Click Apply and run to check whether application is running in browser or not.

 Command Line compilation:





Step 7: Copy the path of AUT containing .html file( where the application is deployed) to C:\Windows\System32\Macromed\Flash\FlashPlayerTrust> flex file. (create a Flex file without extension)

Step 8: Paste the path in Flex file.

Step 9: Again configure application under test using RFT:
·         Click Add
·         Select Flex
·         Click on Add URL of Flex application and provide the path of application.
Ex: C:\TestSparkwithRFT\AdvDataGrid\AdvancedDataGridExample.html
Step 10:  Click finish.
1.    Creating a New Project:
2.    Give script name.

3.    Start recording test.


Example:
-------------------------------------------------------------------------------------------------------
How to Enable IE, Mozilla with RFT
Open Control Panel> JAVA>Advance> disable Java next generation plugin.
Use only one JAVA at a time.
In JAVA control Panel, Click Java Tab and select only one JAVA(both for user and system)
To Enable IE, you may require to register RTXIEEnabler.dll
1.    Open command-prompt.
2.    Navigate to \IBM\SDP\functional Tester\bin
3.    Type regsvr32 RTXIEEnabler.dll
Also you can use processexplorer tool to check, whether RTXIEEnabler.dll file is running or not.


Flex Objects are not getting recognized by IE, Mozilla:
1.    Open command-prompt.
2.    Navigate to \IBM\SDP\functional Tester\bin
3.    Type regsvr32 RFTFlexPlugin.dll
4.    Type regsvr32 RFTFlexPluginPS.dll




References:


4 comments:

  1. This is extremely helpful info!! Very good work. Everything is very interesting to learn and easy to understood. Thank you for giving information. CCNA Training in chennai | CCNA Training chennai | CCNA course in chennai | CCNA course chennai

    ReplyDelete
  2. Awesome Post.Your information about Test Flex Application Using Rational Functional Tester is Intersting. The content show cases your in-depth knowledge. Thanks for Sharing.
    Selenium Training in chennai | Selenium Training in anna nagar | Selenium Training in omr | Selenium Training in porur | Selenium Training in tambaram | Selenium Training in velachery

    ReplyDelete