Skip Headers
Oracle® Application Testing Suite OpenScript User's Guide
Version 9.10 for Microsoft Windows (32-Bit)

Part Number E15488-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

9 Using the Oracle Fusion/ADF Functional Test Module

This chapter provides instructions on configuring and using the OpenScript Oracle Fusion/ADF Functional Test Module, which provides support for functional testing of Oracle Application Development Framework (ADF)-based applications.

9.1 About the Oracle Fusion/ADF Functional Test Module

The Oracle Fusion/ADF Functional Test Module provides support for functional testing of Oracle Application Development Framework (ADF) applications. The Oracle Fusion/ADF Functional Test Module is an extension to the Web Functional Module. The Oracle Fusion/ADF Functional Test Module is fully integrated with the OpenScript platform including the Results view, Details view, Properties view, Console/Problems views, Preferences, Step Groups, Script Manager, and Workspace Manager.

The Oracle Fusion/ADF Functional Test recorder displays commands in the Tree View in easy-to-understand commands. By default, script commands are grouped into Steps Groups by the Web page on which they were performed. Each Step Group contains one or more script commands corresponding to recorded actions that were performed on the page. The default name for the Step Group is the ADF component name.

OpenScript shows the results of Oracle Fusion/ADF Functional Test script playback in the Results view. The Results view shows results for each script command (including duration and summary for failures). The Results Report compiles the same information into an HTML Results Report. Results can be exported from the OpenScript GUI in standard format (CSV / HTML). Results are also generated for unattended playback through the command line.

The Oracle Fusion/ADF Functional Test Module API includes a "adf" class that provides additional programming functionality.

9.1.1 Prerequisites

The Oracle Fusion/ADF Functional Test Module recorder has the following prerequisite:

  • Before recording any script in Oracle Fusion/ADF Functional Test Module, you must configure the ADF Server so that the ADF application uses uncompressed class names.

9.1.2 Key Features of the Oracle Fusion/ADF Functional Test Module

  • The Oracle Fusion/ADF Functional Test Script Module. The New Project wizard (Select New from the File menu) includes an "Oracle Fusion/ADF" option in the Functional Test Group to use when creating Oracle Fusion/ADF functional testing projects in OpenScript. The Oracle Fusion/ADF Functional Test Script Module records functional scripts against ADF Faces applications (Oracle Application Development Framework 11g Release 1 (11.1.1)).

  • ADF Functional-Specific Application Programming Interface (API). The Oracle Fusion/ADF Functional Test Module includes an ADF Functional Test Module API Specification that can be used to customize ADF Functional test-specific scripts.

9.2 Configuring the ADF Server

The Oracle Fusion/ADF Fusion Test Module recorder requires that the ADF application use uncompressed class names. You must configure the application server to specify that uncompressed class names are used for testing purposes.

There are three settings that must be configured in the following files on the ADF server:

9.2.1 Configuring the WEB-INF/web.xml File

This section explains the settings that must be specified in the ADF server web.xml file.

In the ADF server's WEB-INF/web.xml file, set the oracle.adf.view.rich. automation.ENABLED parameter to true. This is required in order for the Oracle Fusion/ADF Functional Test Module to find objects using scope IDs (also known as test IDs or Sub IDs).

The following XML shows how the oracle.adf.view.rich. automation.ENABLED parameter must be specified in the web.xml file before recording Oracle Fusion/ADF Functional Test scripts:

<context-param>

<param-name>oracle.adf.view.rich.automation.ENABLED</param-name>

<param-value>true</param-value>

</context-param>

In the ADF server's WEB-INF/web.xml file, set the org.apache.myfaces. trinidad.DISABLE_CONTENT_COMPRESSION parameter to true. This is required in order for the Oracle Fusion/ADF Functional Test Module to identify ADF component class names.

The following XML shows how the org.apache.myfaces.trinidad.DISABLE_CONTENT_COMPRESSION parameter must be specified in the web.xml file before recording Oracle Fusion/ADF Functional Test scripts:

<context-param>

<param-name>org.apache.myfaces.trinidad.DISABLE_CONTENT_COMPRESSION</param-name>

<param-value>true</param-value>

</context-param>

9.2.2 Configuring the trinidad-config.xml File

This section explains the settings that must be specified in the ADF server trinidad-config.xml file.

In the ADF server's trinidad-config.xml, set the animation-enabled element to false.

The following XML shows how the animation-enabled element must be specified in the trinidad-config.xml file before recording Oracle Fusion/ADF Functional Test scripts:

<animation-enabled>false</animation-enabled>

9.3 Recording Oracle Fusion/ADF Functional Tests

The Oracle Fusion/ADF Functional Test Module records standard ADF components for Oracle Application Development Framework 11g Release 1 (11.1.1). The Recorder creates functional test scripts for automating testing of Oracle Fusion/ADF applications.

ADF components are applet based controls and the Oracle Fusion/ADF Functional Test Module provides the object/attribute information for OpenScript to record interactions with those controls. Actions will be captured in the test script as OpenScript "adf" commands. Other components are standard Web controls which are captured as standard OpenScript "web" and "ft" navigation commands. Correlation rules can be modified by users through the Preferences settings for new scripts.

OpenScript plays back recorded ADF actions/commands which consist of an event plus an object identified by its attributes (for example: adf.inputText(11,"/web:window[@index='0' or @title='inputText Demo']/web:document[@index='0']/web:ADFInputText[@id='dmoTpl:idInputText' and @label='String value']").setValue("String"). The actions used for playback will either be those that are recorded or specified manually in the Java Code view. Playback can be configured through IE only as the Oracle Fusion/ADF Functional Test Module does not support Firefox. Unattended playback is supported through Oracle Test Manager or third-party tools using OpenScript's command line interface. Oracle Fusion/ADF Functional Test scripts do not play in Oracle Load Testing.

The Oracle Fusion/ADF Functional Test Module provides a record toolbar button that lets you initiate the ADF recorder and capture Web/ADF page actions to the script view. The record toolbar includes start and stop recording toolbar buttons. OpenScript recorders also open a floating toolbar that can be used while recording without having to switch between the browser and OpenScript.

9.3.1 Recording Oracle Fusion/ADF Functional Test Scripts

To record ADF Functional Test scripts:

  1. Start OpenScript.

  2. Set the Oracle Fusion/ADF Functional Test Correlation preferences.

  3. Select New from the File menu.

  4. Expand the Functional Testing group.

  5. Select ADF (The Oracle Fusion/ADF script combines both Web and ADF technologies as part of the same script).

  6. Click Next.

  7. Select the Repository and Workspace.

  8. Enter a script name.

  9. Click Finish. A new Script tree is created in the Script View.

  10. Select Record from the Script menu. The browser automatically opens when you start recording.

  11. Load the web page where you want to start recording into the browser.

  12. Navigate the web site to record page objects, actions, and navigations. The page objects, actions, and navigations will be added to the Run node of the script tree.

  13. When finished navigating pages, close the browser.

  14. Select Stop from the Script menu or click the Stop button on the OpenScript toolbar.

  15. Expand the Run node of the script to view the page objects, actions, and navigation nodes in the script tree.

    You can customize the script using the menu options or the Code View for specific testing requirements.

    Note:

    Do not close the script editor view or script project while recording or playing back scripts. Doing so could result in unpredictable behavior in the OpenScript application.

9.4 Playing Back Scripts

OpenScript plays back recorded ADF actions/commands which consist of an object identified by its attributes. The actions used for playback will either be those that are recorded or specified manually in the Java Code view. Unattended playback is supported through Oracle Test Manager or third-party tools using OpenScript's command line interface.

The Oracle Fusion/ADF Functional Test Module provides playback and iterate toolbar buttons that allows users to start the script playback for either a single playback through the script or multiple iterations using data from a databank file. Playback results for Oracle Fusion/ADF Functional scripts can be viewed in the Results and Console views.

9.4.1 Playing Back Oracle Fusion/ADF Functional Scripts

To play back Oracle Fusion/ADF Functional scripts:

  1. Start OpenScript.

  2. Open the Oracle Fusion/ADF Functional script to play back.

  3. Select Playback from the Script menu or click the toolbar button.

    You can view the progress of the script playback in the Console View. You can review the results of script playback in the Results View.

9.4.2 Playing Back Oracle Fusion/ADF Functional Scripts with Iterations

To play back Oracle Fusion/ADF Functional scripts with iterations:

  1. Start OpenScript.

  2. Open the Oracle Fusion/ADF Functional script to play back.

  3. Select Iterate from the Script menu or click the toolbar button.

  4. Set the iteration count.

  5. Select which databank file to use, if necessary.

  6. Set the starting record for the selected databank in the Databank Settings section.

  7. Click OK.

    You can view the progress of the script playback in the Console View. You can review the results of script playback in the Results View.

9.5 Modifying Scripts

Once a script has been created/recorded, you can make modifications to customize the script for your specific testing needs.

9.5.1 Adding Fusion/ADF Actions

The Oracle Fusion/ADF Module includes actions for Oracle Fusion/ADF objects that can be added to a script.

To add Fusion/ADF actions to a script:

  1. Record a Fusion/ADF Functional Test script.

  2. Select the script node where you want to add the action.

  3. Select the Script menu and then select Other from the Add sub menu.

  4. Expand the ADF Action node.

  5. Expand an action node and select the action.

  6. Click OK.

  7. Enter the object identification path for the object. You can use the Capture or Select menu options to capture or select an object path.

  8. Enter any required values to use for the object action.

  9. Click OK. The action node is added to the script tree.

    In the Java Code view, an adf.object(objectId).action() method will be added to the script code:

    adf.inputText("/web:window[@index='0' or @title='inputText Demo']/web:document[@index='0' or @name='w0']/web:ADFInputText[@id='dmoTpl:idInputText' and @label='']").setValue("My Text Input");
    

    The ADF Action node includes actions for objects such as Calendar, Command Button, Command Image Link, Command Link, Command Menu Item, Command Toolbar, Dialog, Go Menu Item, Input Color, Input Combobox List of Values, Input dateSelect ManyChoice, Input List of Values, Input Number Slider, Input Number Spinbox, Input Range Slider, Input Text, Menu, Navigation Page, Page, Panel Accordion, Panel Box, Panel, Splitter, Panel Tabbed, Panel window, Query, Quick Query, Reset Button, Rich Text Editor, Select Boolean Checkbox, Select Boolean Radio, Select Many Checkbox, Select Many Choice, Select Many Listbox, Select Many Shuttle, Select One Choice, Select One Listbox, Select One Radio, Select Order Shuttle, Show Detail, Show Detail Header, Table, Toolbar, Train, Train Button Bar, Tree, Tree Table. Other object actions have corresponding Java code methods.

9.6 Oracle Fusion/ADF Functional Test Module API

The Oracle Fusion/ADF Functional Test Module includes a script Application Programming Interface (API) specific to ADF functional testing. The Oracle Fusion/ADF Functional Test Module recorder creates the Java code that corresponds to the Tree View and displays the Oracle Fusion/ADF Functional Test commands in the Java Code view using easy-to-understand function names. The Java Code view commands correspond to the Tree View and you can edit your scripts in either view.

You can use the Oracle Fusion/ADF Functional Test API to enhance recorded scripts with additional testing functionality. Commands that are specific to the Oracle Fusion/ADF Functional Testing Module are part of the "adf" class. Additional test methods are available in the "web" or "ft" classes. You can also leverage other commands from other enabled classes (services) or general Java commands in your scripts.

Some examples of the Oracle Fusion/ADF Testing Module API include: