10 Using the Oracle Fusion/ADF Load Test Module

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

10.1 About the Oracle Fusion/ADF Load Test Module

The Oracle Fusion/ADF Load Test Module provides support for load testing of Oracle Application Development Framework (ADF) applications. The Oracle Fusion/ADF Load Test Module is an extension to the HTTP Module. The Oracle Fusion/ADF Load 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 Load 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 Load 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 Load Test Module API includes a "adfload" class that provides additional programming functionality.

10.1.1 Key Features of the Oracle Fusion/ADF Load Test Module

  • The Oracle Fusion/ADF Load Test Script Module. The New Project wizard (New from the File menu) includes an "Oracle Fusion/ADF" option in the Load Test Group to use when creating Oracle Fusion/ADF load testing projects in OpenScript. The Oracle Fusion/ADF Load Test Script Module records load scripts against ADF Faces applications (Oracle Application Development Framework 11g Release 1 (11.1.1)). OpenScript captures user actions and records them to the OpenScript script based upon HTTP requests and post data or query strings.

  • Correlation Library. The Oracle Fusion/ADF Load Test Module includes an Oracle ADF-specific library of correlation rules for parameterizing scripts that allows playback of standard ADF Faces applications without manual correlation.

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

10.1.2 Prerequisites

ADF application developers should ensure that all ADF components in the JSP pages have hard-coded and unique component IDs.

10.2 Recording Oracle Fusion/ADF Load Tests

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

ADF components are applet based controls and the Oracle Fusion/ADF Load 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 "adfload" commands. Other components are standard Web controls which are captured as standard OpenScript "http" navigation commands. Correlation rules can be modified by users through the Preferences settings for new scripts.

The Oracle Fusion/ADF Load 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.

10.2.1 Recording Oracle Fusion/ADF Load Test Scripts

To record ADF Load Test scripts:

  1. Start OpenScript.

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

  3. Select New from the File menu.

  4. Expand the Load Testing group.

  5. Select ADF (The Oracle Fusion/ADF script combines both HTTP 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 node of the script tree specified by the Set Record Section setting (the Run node is the default).

  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. ADF scripts include ADF Variables Group nodes that show the attributes and values of ADF variable elements.

    Figure 10-1 ADF Variables Group in Script Tree View

    Surrounding text describes Figure 10-1 .

    Selecting an ADF variable path element in the tree view highlights the value of the selected element in the ADF Rich Response Details View.

    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.

    You can customize the script using the menu options or the Code View for specific testing requirements. The Code View shows the Variable group and variable elements in the solveGroupAdf() and getAdfVariable() methods.

    adfload.solveGroupAdf(
       adfload.getAdfVariable(
          "adf_input_0_5",
          "fragment",
          ".//INPUT[@id='emT:stsch:0:smc1:_0']/@value",
          "0", 0, 0, VariableType.INPUT,
          EncodeOptions.None),
    
       adfload.getAdfVariable(
          "adf_input_0_3_urlEncode",
          "fragment",
          ".//INPUT[@id='emT:stsch:0:startDate::tzDispId']/@value",
          "America%2FLos_Angeles", 0, 0,
          VariableType.INPUT,
          EncodeOptions.URLEncode),
    
       adfload.getAdfVariable(
          "adf_input_0_6_",
          "fragment",
          ".//INPUT[@id='emT:stsch:0:smc1:_1']/@value",
          "1", 0, 0, VariableType.INPUT,
          EncodeOptions.None),
    
       adfload.getAdfVariable(
          "adf_comp_emTfinishbtn",
          "component",
          ".//AdfRichCommandButton[@disabled='true']/@fullId",
          "emT:finishbtn", -1, -1,
          VariableType.RICHCOMPONENT,
          EncodeOptions.None));
    

10.2.1.1 Editing ADF Variables Groups

You can use the ADF Group Variables dialog to edit, delete, and move ADF Variables located on the current page.

Double-clicking an "ADF Variables Group" node in the tree view opens the ADF Group Variables dialog. The ADF Group Variables dialog shows the following information:

Name - shows the name of the ADF variable path element.

XPath - show the XPath to the element.

Value - shows the value of the element.

Segment Index - shows the ADF Rich Response Content segment index value.

Variable Index - shows the variable index value.

Variable Type - show the type of variable element which is the index of appearance that matches the XPath in a segment.

Encode Option - shows which encoding option is used for the element.

Edit - opens a dialog for editing the selected variable element.

Delete - removes the selected variable element from the group.

Up - moves the selected variable element up one row in the group.

Down - moves the selected variable element down one row in the group.

10.2.1.2 Editing ADF Variables XPaths

You can edit an ADF Variable element's XPath. Expand an "ADF Variables Group" in the tree view to view the "SolveADFPath" nodes.

Double-clicking a "SolveADFPath" node in the tree view opens the ADF XPath dialog. The ADF XPath dialog shows the following information:

Variable Type - specifies the type of variable.

XPath - specifies the XPath to the element. Use the toolbar to toggle between the tree view and text view to edit the element's XPath.

Name - specifies the name of the ADF variable path element.

Segment Index - specifies the ADF Rich Response Content segment index value.

Variable Index - specifies the type of variable element which is the index of appearance that matches the XPath in a segment.

Encode Option - specifies which encoding option is used for the element.

10.2.1.3 ADF Component Tree View

The Details View for any ADF page contains a "ADF Component Tree View" tab that displays all the ADF components on the page. OpenScript builds the component hierarchy by analyzing the ADF-Rich-Xml-Content. The tree resembles the parent/child relationship between components displayed on a page. The ADF Component Tree View tab provides a view of the components that exist inside an ADF Rich XML Content page.

The ADF Component Tree View tab of the Details view shows the following options and panes:

Find - select the [Match Type], enter the component attribute text to locate in the tree hierarchy, then click Next or Previous to highlight the attribute in the tree hierarchy.

[Match Type] - specifies the method to use to match the Find text.

  • Full Match - finds attributes that match the exact text specified in the Find field.

  • Partial Match - finds attributes that match any portion of the text specified in the Find field.

  • Match XPath - finds attributes that match the XPath specified in the Find field.

Next - locates the next match in the tree hierarchy.

Previous - locates the previous match in the tree hierarchy.

The tree view pane shows the component attributes in a tree hierarchy. Expand the nodes to show individual attributes.

The Properties pane shows the name and value of the component selected in the tree view.

  • Attribute - shows the component attribute name.

  • Value - shows the component attribute value.

The XML Contents pane show the raw XML for the component. If the raw XML contents exceeds 30KB, a message appears indicating the contents have been truncated. Click Load Remaining Content to load the full XML content.

10.3 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 Load 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 Load scripts can be viewed in the Results and Console views.

10.3.1 Playing Back Oracle Fusion/ADF Load Scripts

To play back Oracle Fusion/ADF Load scripts:

  1. Start OpenScript.

  2. Open the Oracle Fusion/ADF Load 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.

10.3.1.1 ADF Comparison View

After playing back an ADF script, the recorded and played back ADF Rich XML Content can be compared using a textual view of the ADF Rich Component hierarchy in the Details View. Open the Details View and select the Comparison tab. Select the ADF Component Hierarchy Compare option.

10.3.2 Playing Back Oracle Fusion/ADF Load Scripts with Iterations

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

  1. Start OpenScript.

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

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

  4. Select Use Databanks.

  5. Select which databank file to specify the settings for if more than one database is configured for the script.

  6. Specify the settings for the databank file.

  7. Select the Run no more than [ ] iterations option and set the iteration count to the desired number of playback iterations. See Section 4.2.4, "Playing Back Scripts With Iterations" for additional information about iteration settings.

  8. 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.

10.4 Setting Oracle Fusion/ADF Load Test Correlation Preferences

To set Setting Oracle Fusion/ADF Load Test Correlation preferences:

  1. Start OpenScript.

  2. Select OpenScript Preferences from the View menu.

  3. Expand the OpenScript node and the Correlation category.

  4. Expand the ADF Load Test library.

  5. Select or clear the check boxes to enable or disable specific rules.

  6. Click the Add or Edit buttons to modify rules in the library.

  7. Click OK.

10.5 Oracle Fusion/ADF Load Test Correlation Library

The Oracle Fusion/ADF correlation library defines the correlation rules for ADF-based applications. The correlation rules specify the variable names and regular expressions to use to replace dynamic data in ADF applications and navigations. The default Oracle Fusion/ADF correlation library provided with the OpenScript Oracle Fusion/ADF Load Test Module includes the following correlation rules:

  • Java Session id - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern jsessionid=(.+?)(?:"|&) and replaces it with the variable name sessionid in all locations.

  • Correlate ADF Headers - Correlate Headers - this rule implements the default Correlate Headers correlation rules for ADF applications that use dynamic headers.

  • _afrRedirect - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern _afrRedirect=(\d{10,}) and replaces it with the variable name _afrRedirect in all locations.

  • _afrLoop - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern _afrLoop=(\d{10,}) and replaces it with the variable name _afrLoop in all locations.

  • javascript_afrLoop - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern "_afrLoop", "(.+?)" and replaces it with the variable name js_afrLoop in all locations.

  • javascript_afrLoop2 - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern " '(\d{10,})', and replaces it with the variable name js_afrLoop2 in all locations.

  • javascript_sessionid - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern jsession_id=(.+?)', and replaces it with the variable name js_sessionid in all locations.

  • Client Set Cookie - Client Set Cookie - this rule type automatically transforms web page cookie objects with dynamic data.

  • _adf.ctrl-state - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern adf\.ctrl-state=(.+?)["&'&<] and replaces it with the variable name _adf.ctrl-state in all locations.

  • ADF Rich Response Correlation - ADF Rich Response Correlation - this rule implements the ADF Rich component Object Model correlation rules for ADF applications.

  • RedirectURL - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern <redirect>(.+?)< and replaces it with the variable name RedirectURL in all locations.

  • ContextID - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern <contextId>(.+?)</contextId> and replaces it with the variable name ContextId in all locations.

  • setContextId - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern setContextId\('(.+?)'\) and replaces it with the variable name setContextId in all locations.

  • ADF Web Correlation - DOM Correlation - this rule implements the default Web Document Object Model correlation rules for ADF applications.

  • ADF Stream Request - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern AdfPage\.PAGE\.sendStreamingRequest\("(.+?)"\) and replaces it with the variable name stream_request in all locations.

  • adfp_requestId - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern _adfp_request_id=(.+?)& and replaces it with the variable name adfp_request_id in all locations.

  • ADFContentAction - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern <content action="(.+?)"> and replaces it with the variable name ADFContentAction in all locations.

  • newWindowId - Variable Substitution - this rule locates text in the HTML matching the Regular Expression pattern AdfPage\.PAGE\.__handleCachedPageForNewWindow\('(.+?)'\) and replaces it with the variable name newWindowId in all locations.

10.6 Oracle Fusion/ADF Load Test Module API

The Oracle Fusion/ADF Load Test Module includes a script Application Programming Interface (API) specific to ADF load testing. The Oracle Fusion/ADF Load Test Module recorder creates the Java code that corresponds to the Tree View and displays the Oracle Fusion/ADF Load 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 Load Test API to enhance recorded scripts with additional testing functionality. Commands that are specific to the Oracle Fusion/ADF Load Testing Module are part of the "adfload" class. Additional test methods are available in the "http" class. You can also leverage other commands from other enabled classes (services) or general Java commands in your scripts.

Many API methods can be added using the Oracle Fusion/ADF Testing Module Tree View. Additional methods can be added using the Java Code view. Use Ctrl-space in the Java Code view to open an Intellisense window listing available procedures. See the API Reference in the OpenScript help for additional programming information.