14 Using the Siebel Functional Test Module

This chapter provides instructions on configuring and using the OpenScript Siebel Functional Test Module, which tests Siebel applications by accessing objects through the Document Object Model (DOM) of the Web browser and the Siebel test automation framework.

14.1 About the Siebel Functional Test Module

The Siebel Functional Test Module provides support for functional testing of Siebel web applications. The Siebel Functional Test Module is an extension module to the OpenScript Web Functional Test Module that extends the Web testing with Siebel Functional Test recording and playback capabilities. The Siebel 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.

14.1.1 Key Features of the Siebel Functional Test Module

The Siebel Functional Test Module includes the following features:

  • Records Standard Siebel High Interactivity (HI) and Standard Interactivity (SI) components for Siebel versions 7.7, 7.8, 8.0 and 8.1 through integration with Siebel Test Automation CAS Library.

  • Plays back recorded Siebel actions/commands which consist of an event plus object identified by its attributes (for example: GotoScreenlink pageTabs("SiebePageTabs") Accounts Screen).

  • Provides full script code view integration to support script generation for the Siebel Functional Test Module. The Siebel Functional Test Module includes an additional API to support Siebel Functional Test protocol code scripting.

  • Allows users to parameterize user inputs to Siebel Functional Test scripts and drive those inputs from an external data file (Databank).

  • Allows users to insert Tests to validate Siebel HI and SI content on playback.

  • Provides additional options/settings that are specific to Siebel Functional Test scripts within the Siebel Functional Test categories in the preferences interface.

  • Reports playback results for Siebel Functional Test scripts in the Results and Console views.

  • The Siebel Functional Test Script Module API. The Siebel Functional Test Application Programming Interface include Java code methods specific to functional testing of Siebel applications.

The New Project wizard (select New from the File menu) includes a "Siebel Functional Test Script" option to use when creating Siebel functional testing projects in OpenScript. The Siebel Functional Test Script Module records Siebel applications using the Siebel test automation framework. OpenScript captures user actions and records them to the OpenScript script nodes in a highly readable sequence of navigations and actions.

14.2 Functional Testing Siebel Applications

The following is an outline of the procedures and best practices used to perform functional testing of Siebel applications with the OpenScript application.

14.2.1 Prerequisites

The instructions in this document assume the following prerequisites:

  • Testing hardware/environment is available.

  • The Siebel applications are installed on a Siebel Server.

  • The Oracle Application Testing Suite applications have been installed on a testing machine.

  • The test machine can access the Siebel applications.

  • Some steps may require system administrator level privileges for the Siebel Server.

  • License for Siebel Test Automation required.

14.2.2 Setting up the Siebel Test Environment

The functional test environment should approximate as closely as possible a working Siebel deployment environment. However, hardware cost constraints may be a limiting factor. This section provides recommendations about the basic test system configuration. Additional test system configurations can be used based upon hardware and network availability.

The basic n-tier configuration should consist of the following systems:

  • Web Server

  • Siebel Server

  • Database Server

  • Database Storage

See the Siebel Installation Guide in the in the Siebel document bookshelf for information about hardware and Siebel installation requirements.

Notes:

  • Siebel applications can contain High-Interactivity (HI) components, which use ActiveX controls, and Standard-Interactivity (SI) applications, which use standard HTML. Applications may also use a combination of HI and SI components. Testing methods vary depending upon the type of components being tested. See the "Automating Functional Tests" chapter in the Testing Siebel eBusiness Applications document in the Siebel document bookshelf for a description of the component types.

  • In general, Siebel applications are more memory intensive than CPU intensive. If trade-offs need to be made in test hardware decisions, memory should be given higher consideration than CPU speed.

  • Siebel web applications use Cookies to maintain the state information.

14.2.3 Enabling Siebel Test Automation

The Siebel test automation framework must be activated on the Siebel server for OpenScript to access it. Changing the Siebel configuration file may require system administrator level privileges for the Siebel server. A license is also required to use the Siebel Test Automation framework. Contact your account representative for additional information about licence requirements.

14.2.3.1 Siebel 7.x

To enable the test automation framework in Siebel 7.x:

  1. Open the .CFG file for the Siebel application on the Siebel server.

  2. Set the EnableAutomation and AllowAnonUsers switches in the [SWE] section as follows:

    [SWE]
    EnableAutomation = TRUE
    AllowAnonUsers = TRUE
    ...
    

    See the Siebel Testing Siebel eBusiness Applications documentation if you need to set up secure access to the Siebel Test Automation framework.

  3. Restart the Siebel Server.

14.2.3.2 Siebel 8.x

To enable the test automation framework in Siebel 8.x:

  1. Log into Siebel as Administrator.

  2. Go to "Site Map".

  3. Go to "Administration - Server Configuration".

  4. Select "Call Center Object Manager" (provided you want to enable automation for Call Center).

  5. Under list of Components, click the Parameters tab.

  6. Find EnableAutomation and AllowAnonUsers parameters and set both to TRUE.

  7. Restart the Siebel Server.

14.2.4 Script Creation Techniques

The following are tips and techniques to use when creating Siebel load test scripts using the OpenScript application:

  • Disable browser caching to make sure the pages are returned from the server rather than the browser cache.

  • Record actions from login through logout to make sure parameters are passed properly between page navigations.

  • Record actions slowly in the Siebel environment to make sure the recorder records all actions to the OpenScript script. If possible, watch as the OpenScript script pages are added to the script tree.

  • Siebel Popup windows may initially appear incorrect. Resize the window slightly to refresh the page in the popup window.

  • Do not insert Siebel Tests in Siebel popup windows unless the test is necessary.

  • Save the script in OpenScript using Save As on the File menu. When you save a Siebel proxy-recorded script, OpenScript automatically creates a Java Agent versions of the script in the workspace. Depending upon the size of the script, the file save operation may take some time.

14.2.5 Setting Browser Options

When recording and playing back scripts to test an application, you want to make sure the pages returned are from the server and not the browser cache. To verify or change the browser settings:

  1. Open Internet Options from the Control Panel.

  2. Click Settings in the Temporary Internet files section.

  3. Select Every visit to the page.

  4. Click View Objects in the Temporary Internet files folder section.

  5. Verify that the downloaded Program files directory does not contain multiple versions of the Siebel High Interactivity Framework and Siebel Test Automation programs installed.

  6. If necessary, remove the duplicate or older versions.

  7. Close the Downloaded Program Files window.

  8. Click OK to close the Temporary Settings.

  9. Click OK to close the Internet Properties.

14.2.6 Starting the Siebel Application

When you start the Siebel application in the browser, the URL must include the Siebel Web Engine (SWE) command to generate the test automation framework information. The AutoOn Siebel Web Engine command (SWECmd) is added to the URL as follows (SWECmd is case-sensitive):

http://hostname/application/start.swe?SWECmd=AutoOn

where hostname is the machine name or IP address of the Siebel server and application is the name of the Siebel application. For example, application could be callcenter or callcenter_enu depending upon the Siebel version.

Enter the start URL and command into the browser address. for example:

http://siebelServer/callcenter_enu/start.swe?SWECmd=AutoOn

As you navigate pages, OpenScript records page navigation to the OpenScript script tree.

14.2.7 Determining a Siebel Component Type

Siebel applications can include High-Interactivity (HI) object and Standard-Interactivity (SI) object types. You can use the Inspect Path feature of OpenScript to determine the type of an object in an application.

  1. Click the Inspect Path toolbar button or the Capture button to open the Select Object dialog box.

  2. Move the mouse cursor over the page in the Siebel application to view the component type. The current component is highlighted in the OpenScript browser and the path appears in the Select Element dialog box. Siebel HI component types are indicated by /siebelft:cas[ClassName= in the Path/Object fields:

  3. The path to HI component types is also referred to as the Object Descriptor String (ODS) and is used in OpenScript to recognize applets used with the Siebel application.

    SI component types are indicated by /web:window[index='0']... in the Path field.

  4. Press F10 to capture the object path. You can copy the path from the dialog box using Ctrl-C and paste using Ctrl-V.

The following are examples of complete object paths (line breaks added for clarity):

High-Interactivity (HI) Path.

/siebelft:cas[ClassName='SiebApplication' and 
        RepositoryName='Siebel Universal Agent']
   /siebelft:cas[ClassName='SiebScreen' and 
           RepositoryName='Web Call Center Home Screen']
   /siebelft:cas[ClassName='SiebView' and 
           RepositoryName='Home Page View (WCC)']
   /siebelft:cas[ClassName='SiebApplet' and 
           RepositoryName='Sales Message Alert List Applet Tiny']
   /siebelft:cas[ClassName='SiebList' and 
           RepositoryName='SiebList']

Standard-Interactivity (SI) Path:

/web:window[index='0']
   /web:document[index='10']
   /web:span[text='Search' or index='1']

or

/web:window[index='0']/web:document[index='10']
   /web:form[index='0' or name='SWEForm1_0']
   /web:input_text[id='s_1_1_16_0' or name='s_1_1_16_0' or index='1']

14.3 Recording Siebel Functional Test Scripts

The Siebel Functional Test Module records standard Siebel High Interactivity (HI) and Standard Interactivity (SI) components for Siebel versions 7.7, 7.8, 8.0 and 8.1 through integration with Siebel Test Automation CAS Library. Siebel Test Automation must be enabled on the Siebel server side in order to successfully record these events. The Recorder creates functional and regression test scripts for automating testing of Siebel applications.

Siebel HI components are Active-X based controls and Siebel Test Automation provides the object/attribute information for OpenScript to record interactions with those controls. Actions on HI controls will be captured in the test script as OpenScript "siebelFT" commands. Siebel SI components are standard Web controls which are captured as standard OpenScript "web" commands using Web Functional Test object attributes; however, Siebel Test Automation may provide additional attributes to identify SI controls which take precedence over standard Web object/attributes. Object Identification attributes can later be modified by users through the Preferences global settings for new scripts or for already recorded commands in the tree view or code view. Recording can be configured through Internet Explorer only as Siebel does not support Firefox.

The Siebel Functional Test Module provides a record toolbar button that lets you initiate the Siebel recorder and capture Web/Siebel 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.

Before recording Siebel Functional test scripts, make sure the Siebel test automation framework is activated on the Siebel server. See Functional Testing Siebel Applications for details about Prerequisites and the Siebel Test Environment.

14.3.1 Setting Siebel Functional Test Record Preferences

To set Siebel Functional Test record preferences:

  1. Start OpenScript.

  2. Select OpenScript Preferences from the View menu.

  3. Expand the OpenScript node and the Record category.

  4. Select Siebel Functional Test.

  5. Set the General preferences. See Section 2.5.6, "Siebel Functional Test Preferences" for descriptions of the Record Preferences settings.

  6. Click OK.

14.3.2 Adding/Editing SI Element and Site Map Link Paths

The Siebel Functional Test Module can use special object identifier paths when recording Standard Interactivity (SI) Web objects and Sitemap links. The object identifier paths specify the element attributes to use to identify Siebel SI controls or Sitemap links. The Siebel attributes are RN (repository name), OT (object type) and UN (unique name).

To add or edit an SI element or Sitemap link path:

  1. Select the OpenScript Preferences from the View menu.

  2. Expand the Record node and select Siebel Functional Test.

  3. Click the General tab.

  4. Click Edit for SI Element path or Sitemap path.

  5. Click Add or select an existing attribute and click Edit.

  6. If adding a new attribute, enter a name for the attribute.

  7. Add or edit attributes for the path.

    For each attribute, you specify a name (typically a Siebel object attribute), an operator, a value and a value type. As you add attributes, OpenScript builds the object identifier path using logical AND between each attribute. Click Edit to change between logical OR and AND.

  8. Click OK. The object identifier path is updated in the record preferences.

14.3.3 Recording Siebel Functional Test Scripts

To record Siebel Functional Test Scripts:

  1. Start OpenScript.

  2. Select New from the File menu.

  3. Select Siebel Functional Test Script.

  4. Click Next.

  5. Select the Repository and Workspace.

  6. Enter a script name.

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

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

  9. Load the Siebel application using the AutoOn Siebel Web Engine command (?SWECmd=AutoOn) in the URL into the browser.

  10. Log in and 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).

  11. When finished navigating pages, log out and close the browser.

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

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

14.4 Modifying Scripts

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

14.4.1 Adding Siebel Actions

The Siebel Functional Test Module includes actions for Siebel objects that can be added to a script.

To add Siebel actions to a script:

  1. Record a Siebel 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 Siebel Functional Test node.

  5. Expand an action node and select the action.

  6. Click OK.

    The Siebel action dialog boxes let you define the action to perform during playback of a Siebel Functional Test script. This dialog box is used for most Siebel actions including Application, Button, Calculator, Calendar, Checkbox, Communications Toolbar, Currency, List, Menu, Page Tabs, PDQ, Rich Text, Screen Views, Task Assistant, Text, Text Area, Threadbar, Toolbar, Tree, and View Applets. Specific values may be required for specific actions.

    • Action: Shows the action to perform. Additional values for variables or attributes may be required depending upon the action to perform.

    • Path: Specify the object ID of the Siebel or Web object on which to perform the action. You can use the Capture or Select menu options to capture or select an object path.

    • Value(s): Specify the variables or attributes as required for the specific action on an object.

  7. Enter the object identification path for the object.

  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, a siebelFT.object(objectId).action() method will be added to the script code:

    siebelFT.menu(100,"/siebelft:cas[@ClassName='SiebApplication' and 
       @RepositoryName='Siebel Universal Agent']
     /siebelft:cas[@ClassName='SiebMenu' and 
       @RepositoryName='SiebMenu']").select("File\\\\File - Logout");
    

    The Siebel Functional Test node includes actions for objects such as Application, Calculator, Calendar, Communications Toolbar, Page Tabs, Task Assistant, Threadbar, and View Applets, etc. Other object actions have corresponding Java code methods.

14.4.2 Handling Non-Standard Siebel Dialog Boxes

Most dialog boxes invoked in Siebel applications will be dismissed or closed properly during script playback. However, in certain circumstances with customized Siebel applications, some non-standard Alert/Confirmation dialog boxes may not be dismissed or closed during script playback.

This may happen with custom dialog boxes written while customizing default Siebel applications if the Siebel developer implements the custom dialog box in a way that blocks callbacks from the server. Typically, the custom dialog boxes have the caption “Internet Explorer” or something other than "Siebel" (the default caption for default Siebel dialog boxes). The default Siebel dialog boxes are implemented in a way that does not block callbacks.

For example, when recording a Siebel transaction, at a certain point you click a button (or do something else) and an Alert/Confirmation dialog box appears. You dismiss the Alert/Confirmation dialog box by clicking OK and proceed further. When you play back the script, the script may halt because it is unable to dismiss or close the custom Alert/Confirmation dialog box.

When OpenScript clicks the Button, it waits for a callback from the Siebel server before considering the click event completed. If OpenScript does not receive a callback from the server, OpenScript considers click event to have failed and throws an exception and terminates script playback.

You can customize the script to handle non-standard Siebel dialog boxes during script playback. This involves adding custom Java code to the script to dismiss the dialog without relying on a callback call from the Siebel server.

In the Tree view, the click events for the dialog box actions will appear similar to the following click events:

Figure 14-1 Script Tree View for Click Events

Description of Figure 14-1 follows
Description of "Figure 14-1 Script Tree View for Click Events"

In the Java Code view, the click events for the dialog box actions will appear similar to the following click events code:

siebelFT.button(311,"/siebelft:cas[@ClassName='SiebApplication' and 
       @RepositoryName='Siebel Power Communications']
    /siebelft:cas[@ClassName='SiebScreen' and @RepositoryName='Orders']
    /siebelft:cas[@ClassName='SiebView' and
       @RepositoryName='Order Entry - Line Items View (Sales)']
    /siebelft:cas[@ClassName='SiebApplet' and 
       @RepositoryName='Jawwal Order Entry - Order Form Applet Dashboard (Sales)']
    /siebelft:cas[@ClassName='SiebButton' and 
       @RepositoryName='BSubmit']").click();

web.confirmDialog(312,"/web:dialog_confirm[@index='0' and 
    @text='You are about to submit the order #: 1-3832871\n\n Do you want to
    continue?']").clickOk();

In the Java Code view, add the following code before the Submit button click event:

new Thread(new Runnable() { 
     public void run() { 
    try {
        Thread.sleep(4000);
        java.awt.Robot robot = new java.awt.Robot();
        robot.keyPress(java.awt.event.KeyEvent.VK_ENTER);
        robot.keyRelease(java.awt.event.KeyEvent.VK_ENTER);
        } catch(Exception x) {
             }
           }
         }
     ).start();

Next, comment or delete the code for the recorded click event for dismissing the Alert/Confirmation dialog box. The resulting code should appear similar to the following code:

//initiate a new thread which will dismiss the Alert/Confirmation dialog box
new Thread(new Runnable() { 
     public void run() { 
    try {
        Thread.sleep(4000);
        java.awt.Robot robot = new java.awt.Robot();
        robot.keyPress(java.awt.event.KeyEvent.VK_ENTER);
        robot.keyRelease(java.awt.event.KeyEvent.VK_ENTER);
        } catch(Exception x) {
             }
           }
         }
     ).start();
//invoke the dialog box that generates the Alert/Confirmation dialog box
siebelFT.button(311,"/siebelft:cas[@ClassName='SiebApplication' and 
       @RepositoryName='Siebel Power Communications']
    /siebelft:cas[@ClassName='SiebScreen' and @RepositoryName='Orders']
    /siebelft:cas[@ClassName='SiebView' and
       @RepositoryName='Order Entry - Line Items View (Sales)']
    /siebelft:cas[@ClassName='SiebApplet' and 
       @RepositoryName='Jawwal Order Entry - Order Form Applet Dashboard (Sales)']
    /siebelft:cas[@ClassName='SiebButton' and 
       @RepositoryName='BSubmit']").click();

The above custom code does the following: before clicking the Siebel button that generates the Alert/Confirmation dialog box, a new thread is started. The thread sleeps for 4 seconds (4000 ms, which can be changed to your own delay). While the thread is asleep, the Siebel button gets clicked (it happens in the major thread, so no thread locks each other) and the Alert/Confirmation dialog box appears. The thread wakes up after the specified delay and invokes an ENTER key event (the same as a manual Enter key press). Since the Alert/Confirmation dialog box's OK button always has focus, it gets dismissed by the thread's ENTER key call.

14.4.3 Siebel Functional Test Module API

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

Some examples of the Siebel Testing Module API include:

  • Applet

  • Application

  • Attribute

  • Button

  • Calculator

  • Calendar

  • Cells

  • Checkbox

  • Communications Toolbar

  • Currency

  • Page Tabs

  • PDQ

  • Pick List

  • Rich Text

  • Screen Views

  • Task Assistant

  • Text

  • Text Area

  • Threadbar

  • Toolbar

  • Tree

  • View Applets

Many API methods can be added using the Siebel Functional Test 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.