http://www-1.ibm.com/support/docview.wss?rs=953&context=SSJMXE&dc=DA400&uid=swg27011420&loc=en_US&cs=UTF-8&lang=en&rss=ct953rational
Functional testing Adobe Flex applications
| ||||||
Content | ||||||
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.
IntroductionUsing IBM Rational Functional Tester, version 7.0.1, you can record and playback test scripts against Flex based user interfaces, embedded in an HTML page running inside a Web browser and verify that the application functions correctly. Automated testing of Flex applications require you to load supporting files. These supporting files can be loaded in the two different stages:
PrerequisitesBefore you begin, verify the following software is installed.Developer
AssumptionsThis document includes the following assumptions regarding the testing of Flex application:
OverviewThe tasks that you perform in testing Flex applications depend on the application and whether you are a developer or a tester. You can test applications that are enabled for Rational Functional Tester or test applications that are not enabled for Rational Functional Tester. These are the general steps for preparing and testing Flex applications:
DeveloperTo enable Flex applications for functional testing, perform the following steps:
Software testerFor applications that are enabled for functional testing, perform the following steps:
rft.swc ) to enable and deploy the Flex application. Testers need to provide these files to the developer.Configuring the development environment for enabling Flex applicationsTo configure the Flex development environment:
Enabling flex application for functional testingDevelopers can enable Flex applications for functional testing. This section is intended for Flex application developers and explains different ways of enabling the Flex application for functional testing. Enable the Flex applications for testing by building the Flex application with Functional Tester agent (rft.swc) and Flex automation framework libraries.Developers use the following tools to enable a Flex application for testing:
Using the Flex Builder to enable Flex applicationsYou can use Flex Builder to make Flex applications ready for functional testing. Flex Builder is useful when you want to develop Flex applications (.swf files) that are ready for functional testing.To set up Flex Builder to support Flex automation and functional testing:
Using the command-line to enable Flex applicationsYou can use the Flex command-line compiler to enable a Flex application for functional testing. Compile the Flex application using the Functional Tester Agent and Flex Automation Libraries by running the following command: At the command line, type the following, and then press Enter: "flex builder install directory\Flex SDK 2\bin\mxmlc" -include-libraries+= "flex builder install directory\Flex SDK 2\frameworks\libs\automation.swc; flex builder install directory\frameworks\libs\automation_agent.swc; flex builder install directory\Flex SDK 2\frameworks\libs\automation_charts.swc; functional tester directory\FunctionalTester\bin\rft.swc" Test.mxml The The default location the flex builder install directory on Windows is C:\Program Files\Adobe\Flex Builder 2 and functional tester directory is C:\Program Files\IBM\SDP70 This command is also available as a batch file functional tester directory\Functional Tester\Flex folder. For example, if your .mxml file is Test.mxml , the command to run the batch file is as follows: buildapplicationwithadaptor.bat Test.mxml Creating an HTML wrapperThe developer creates an HTML wrapper after compiling the Flex application with the Functional Tester agent and Flex automation testing libraries. The wrapper embeds the .swf file in an HTML page by using theobject and embed tags. You can use the default HTML wrapper file that the compiler in Flex Builder generates along with the Flex application or use the HTML wrapper file in the functional testing application folder. After creating the HTML wrapper, the developer passes the application and the HTML wrapper to the testers for functional testing. Typically developers deploy the files to a Web server that testers access. The following example shows how the Flex application Configuring the environment for testing Flex applicationsCorrect environment setup for testing Flex applications helps ensure reliable functional testing results.To configure the Flex testing environment:
Testing Flex applicationsThis section is intended for testers and describes the steps for automating Flex applications with functional tests. You can test a Flex application that has been enabled for functional testing using Flex Builder or Flex command-line compiler. Testers typically work with Flex applications that a Flex developer provides. Developers provide applications in two broad categories:
Testing Functional Tester enabled Flex applicationDevelopers provide the application in two ways:
Testing Functional Tester enabled Flex application from Web serverYou can test a Flex application that has been enabled for functional testing. The developer deploys the Flex application to be tested on a Web server and provides the URL. You can also deploy the files, provided that you can access the Web server and the application files. To test an enabled Flex application:
Testing enabled Flex application from local test computerYou can test a Flex application that is embedded in an HTML wrapper locally. Before testing a Flex application locally, verify that the .swf file is trusted.Assigning trust designations for Flex applications When testing Flex applications on a local computer, adjust settings so that the application is trusted. To run the application locally, the application under test has to be trusted. The paths to individual files or directories can be trusted rendering all the files in each selected directory and any of its subdirectories trusted. You can assign trust designations.To assign trust designations:
Testing Functional Tester enabled Flex application locally
Advantages and limitations of testing RFT enabled Flex applicationsThree advantages encourage enabling Flex applications for functional testing:
Review the following limitations regarding enabled Flex applications:
Testing a non-enabled Flex application from a Web serverYou can test a Flex application that is not enabled for functional testing on a Web server. First the developer deploys the application to a Web server and provides the address.Important: If you encounter problems while the Flex application is loading using the Runtime Loader test page, check the security settings of Internet Explorer ActiveX and plug-ins. Configuring the Runtime loaderYou can prepare a Flex application for testing without modifying and recompiling the application. You can configure the Runtime Loader to enable an application for testing when they do not want to modify the Flex application by adding the references to the Rational Functional Tester Agent and Flex automation framework libraries. To enable the testing of Flex applications that are not compiled using the Functional Tester agent and automation libraries, perform the following steps:
Testing non-enabled Flex application using RuntimeLoader Testing is performed using the RuntimeLoader component that is available with Rational Functional Tester. To test a non-enabled Flex application, perform these steps:
Advantages and limitations of testing non-enabled Flex applicationsThere are two advantages to testing Flex applications that are not enabled for functional testing:
Review the following limitations regarding non-enabled Flex applications:
TroubleshootingEnsure that your environment and application is configured correctly. This topic describes several common troubleshooting issues. Verify the following conditions:
|