Sunday, April 19, 2009

Flex automation testing with QTP

QTP can be used to test the Flex application. You need to perform following steps to setup recording a flex application with qtp.

  1. Install QTP 9.2
  2. Install Internet Explorer
  3. Install flash player debug version for IE
  4. Install Flex Builder 3
  5. Install QTP plugin of flex from FLEX_BUILDER3/Installers/QTP_Plugin_Installer
  6. Compile your flex application with automation libraries. It can be done in two ways; either use -include-libraries parameter in Flex Builder3 or use mxmlc ant task. This step is must otherwise QTP will not recognize the flex application
  7. To record a test in QTP, you must compile the application’s SWF file and generate the HTML wrapper files. The main wrapper file defines the application as an object on the page and embeds it so that Flash Player is invoked when the page is requested. You cannot request the application’s SWF file directly. You can write the HTML wrapper yourself, or generate it with the compiler.
  8. Start QTP
  9. QTP wil show the all plugins on startup, select the flex plugin and continue
  10. Start recording for your flex application.

18 comments:

Weight Loss/ Life Coach said...

could you post an example of how you did it with the ant task?

Weight Loss/ Life Coach said...

could you post an example of how you did it with the ant task?

Vishnu Agrawal said...

you can refer to my earlier post

http://vishnuagrawal.blogspot.com/2009/04/build-flex-application-with-automation.html

Unknown said...

Can we do this process to 8.2 QTP?

Vishnu Agrawal said...

Not sure about QTP 8.2. I do not have this version. You can give it a try.

Unknown said...

Hi Vishnu,
I have tested that flex application can be made qtp compliant. Can this be done for pure AS3 project as well.

Ashish said...

Hi,
I have QTP 10 and i followed all above step but i am still unable to recognize the FLEX Objects as the application, i am testing, doesn't contain Normal flex objects.I contains Customized Flex objects.

Can you help me out in this.

Unknown said...

I am creating the object tag within a div tag when i do like this QTP is not recognizing the flex application
can you help as to solve this problem.

Bloger.Bee said...

Hi Vishnu,
Can you please elobarate step no: 6.

I am using qtp 9.5 and i am stuck at step no 6.

Creative Blogger said...

I can eloberate on step 6:
Copy the qtp.swc and automation_agent.swc files from the flex_automation_installer/frameworks/libs directory to flex_builder_dir/Flex SDK 2/frameworks/libs.
Copy the automation_agent_rb.swc file from the flex_automation_installer/frameworks/locale/en_US directory to flex_builder_dir/Flex SDK 2/frameworks/locale/en_US.
Start Flex Builder.
Create a new Flex Project.
Select your new Flex project in the Navigator.
Select Project > Properties > Flex Compiler.

Unknown said...

Can somebody please help me here.

The application we are automating is a flex application developed by a third party. They develop and deploy the code in one of our servers.
I have asked them to compile the flex application with the 4 automation libraries(automation.swc, automation_dmv.swc,automation_agent.swc and qtp.swc )and create a HTML wrapper for the compiled SWF file.
They have done that and have deployed the code. I have installed QTP 10, along with flex builder plugin.
But when i try to automate, the scripts just dont get generated.
I tried with a sample flex application and it works fine. The scripts get generated without any issues.

Can anyone tell me if i have missed anything here.

Ram said...

I am facing the same problem :
like even though my dev has compiled their code with the mentioned libraries and I start QTP with flex builder plugin ---- I am not able to recognise the flex objects.
it just shows as browser("xxx").Page("xxx").winObject("MacromediaFlashPlayer").click 122,183

can someone plase let me know if I am missing anything here?

thanks much

Ashish said...

Hi,
Verify that the objects that dev are using are FLEX standard objects or customised objects.. As if they are customised object then those 4 files that dev has deployed in there build will not work.

(as per my understanding and Experience with flex automation)

Unknown said...

hi Ashish

Thanks for the pointer and my dev has confirmed that the app has both customised and standard objects in it.
And you are right the standard objects are getting recorded.

But what about the customised objects....Is there anyother process that we need to follow?

can you please let me know


thanks in advance

Ashish said...

I afraid my Friend.. you can not automate customized objects using Objected recognition method..

But there is a work around with other tools like SeeTest, Egg Plant, Sikuli etc. These tools are are based on Image recognition method.

Try these tools if these can help u.

: Ashish Sharma

Unknown said...

My application has Flex 3.5 used in it. Does this need the flex builder prof/its QTP plugin to be of 3.5 version. I was unable to find the flex builder 3.5 on the adobe site.

senthil said...

Hi,
I am very new to Flex testing using QTP...After installing Flex addin, FLex Components are identifying as a "WebObject".Pls send me the procedure and also is there anything need to be included in develpment side...

Thanks,
Senthil

Unknown said...

Can Robotlegs flex be tested using QTP?
Which version of QTP and if other 3rd party tool will be required?