QTP Recording scripts for Adobe Flash / Flex

Posted on Feb 2 2008 - 12:53am by Raj

Testing Rich internet applications developed in Flex / Adobe Flash using Quick Test pro – Recording scripts.

To record a test in Mercury QTP, you must compile the application’s Adobe 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.
You point QTP to the wrapper file that embeds the application SWF file.
You can use Adobe Flex Builder or the command-line compilers to generate the SWF file for you. After you pre-compile the SWF file, deploy the SWF file and the HTML wrapper files, plus any additional assets such as Runtime Shared Libraries (RSLs), graphics, or other SWF files, in a directory on the web server.
To record a test, you either specify that QTP runs the test on the currently open browser or specify the location of the application as a URL. In the second case, QTP launches the browser and passes it the request URL that you specified. You determine which method to use in the Record and Run Settings dialog box.
In general, you should use a web server to serve the HTML wrapper to the QTP client. You cannot request the HTML wrapper file on the file system.
To have QTP run the test on an application that is currently running in an open browser window, select the Record And Run Test On Any Open Browser option. To have QTP open a browser and request a URL, select the second option, as the following example shows:

 

When you play back the test, QTP opens the browser and requests the same URL.
Be sure to specify an HTML file or other wrapper file type that embeds the application’s SWF file. You should not request the SWF file directly.

About the testing script

About the Author

Leave A Response