IBM Support

Enabling support for Flex Custom Controls test automation

Product Documentation


Abstract

IBM® Rational® Functional Tester version 8.1.0.2 supports testing of Flex custom controls. Depending on the user requirement, Rational Functional Tester provides two ways to support testing for Flex Custom Controls.

Content

Rational Functional Tester supports Flex custom controls in a generic and specific way.

Specific support: If you want to map a specific control to a proxy and have the data verification point and the datapool support, the specific custom control support helps you achieve it. The basic requirements are:

  1. Writing a delegate and mapping the events and properties in the FlexEnv.xml file.
  2. Creating a proxy and the test object associated with control. The attached project has .jar containing the RandomWalkproxy and RandomWalktestObject.
  3. Mapping the proxy to the control in the *.rftcust file generated using the proxy SDK wizard. For correct mapping, refer to the *.rftcust file in the attached project.

Proxies can be created and deployed using the proxy SDK wizard. Certain changes must be done regarding the base class for proxy and the test object. These are given in the sample proxy and test object. Once the deployment is done and the proxy is mapped to the control, you can test the specific control.

Main features of specific support for custom control:
  • Control is mapped to a more meaningful proxy and test object. For example, RandomWalk control gets mapped to randomWalkProxy and randomWalktestObject.
  • Role can be assigned to the control. For example, the given custom control has role “List” assigned to it.
  • Recognition properties can be added.
  • Data verification point and data driven test can be implemented.
  • Recording is control specific. For example, you now record on the same control: list__randomWalk_RandomWalk1().select("Food");
  • getMethodSpec method is overridden to emit the methods as required or it goes to superclass and event might be generated as performAction(). See FlexRandomWalkproxy.java
  • getTestObjectClassName method must be overridden to point to the correct test object.

Use the attached sample to test the two scenarios :

Scenario 1
  1. Deploy the randomWalk_AT folder to your application directory. Notice that this directory contains RandomWalk control and RandomWalkDelegate.
  2. Copy the contents of ClassInfo tag in the FlexCustom.xml file available in the RandomWalk_AT directory into the FlexEnv.xml.
  3. Invoke the application using mypage.htm in the RandomWalk_AT and try recording. The generated script records the action as performAction.

Scenario 2

Follow the steps mentioned in the first scenario to create the customcontrol, delegate and FlexEnv.xml in place.
  1. Deploy the .jar and .rftcust file to the C:\Documents and Settings\All Users\Application Data\IBM\RFT\ directory.
  2. Close Rational Functional Tester, all the Java enabled applications and the browsers so that the new customization class is loaded. Restart Rational Functional Tester, test applications and then start recording the script.

Troubleshooting:
After recording, the script displays compilation error for the test object. To resolve that you must add the import statement for the customtestObject. This import statement can be added to the template file available in the Rational Functional Tester bin directory or project specific template.

For more information on Flex custom controls and generic support, see
http://publib.boulder.ibm.com/infocenter/rfthelp/v8r1/topic/com.ibm.rational.test.ft.doc/topics/t_flex_custom_ctrl.html

FlexCustomControl.rar

[{"Product":{"code":"SSJMXE","label":"IBM Rational Functional Tester"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Record \/ Author tests","Platform":[{"code":"PF033","label":"Windows"}],"Version":"8.1.0.2","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
17 June 2018

UID

swg27016772