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

Part Number E15488-02
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

4 Using Databanks

OpenScript allows users to parameterize script data inputs to perform data driven testing using Data Banking. Users can select any data inputs for their script and then substitute a variable to drive the input from an external file during playback. Multiple Data Bank files can be attached to a single script and users can specify how OpenScript assigns data during script playback.

Understanding Data Driven Testing (Parameterization)

Data Driven Testing, or parameterization, allows you to quickly and efficiently create automated data-driven tests.

The OpenScript Modules record parameters defined by each page of the Web application to a script. Databanks are used to hold unlimited amounts of input data that can be automatically fed as parameters into your Web application when the script is run. You can use the OpenScript databanking features to define variable values in script parameters and substitute values from Databank files for the variable values.

During playback, the parameters in the Web page are filled with values from the Databank file. Databank files can be easily created or modified using any simple text editor, spreadsheet, word processor, or database application. Users can create sophisticated unattended regression tests to thoroughly exercise a Web application by using varied input data from Data Bank files.

Data Input Parameterization enables users to parameterize recorded script inputs to perform data driven testing in either the script GUI view or code view. These inputs could be form field inputs for Web applications but could also be other types of script inputs that users may parameterize. Types of inputs users may parameterize include:

Data Input Sources enables users to drive input values from an external CSV file or other external data source such as a database (i.e. using a database query to pull inputs from a database table).

Data Parameterization GUI View enables users to configure the inputs they want to parameterize and the data source they want to drive the inputs from through a substitute variable GUI interface. For example, the "ticker" query string parameter for "Page [4] Ticker List" in the following Tree View is set to the variable value "{{fmstocks_data.ticker,ter}}".

Within the variable "{{fmstocks_data.ticker,ter}}", "fmstocks_data" is the name of the Databank file, ".ticker" identifies the field name within the Databank file, and "ter" is the recorded value.

Data Parameterization Code View Commands enable users to specify the inputs they want to parameterize and the data source they want to drive the inputs from through data parameterization in the code view.

For example, the "ticker" query string parameter for "Page [4] Ticker List" in the above Tree View appear as http.querystring(http.param("ticker", "{{fmstocks_data.ticker,ter}}") in the http.get method code in the Code View, as follows (line breaks and spacing added for clarity):

beginStep("[4] Ticker List", 3422);

{

   http.get(6, "http://testserver2/fmstocks/{{LINK_1_3,TickerList.asp}}", 

        http.querystring(http.param("ticker", "{{fmstocks_data.ticker,ter}}"), 

             http.param("company", "")),  null, true, "ASCII", "ASCII");

}

endStep()

Using Script Databanks

Databanks are used to hold unlimited amounts of input data that can be automatically fed into your Web application. During playback, the parameters in the Web page are filled with values from the databank file. The databank and script parameter shortcut menu options allow you to map parameters in a script to fields in a databank file as variable names.

Scripts must be configured to used databanks. Use the Configure Databank option on the Script menu to specify the databank file(s) to use with a script. Scripts can be configured to use more than one databank file.

When you record a script that has a navigation that uses parameters, the parameter nodes appear under the Query String node:

In the Code View, the parameters appear in the http.param parameters of the http.querystring parameter:

When you configure the databank(s) to use with the script, the Get next databank record from databank name node and Java code are added to the script.

Select the script parameter node to map to a databank and use the Substitute Variable option on the right-click shortcut menu to select the databank field name to map to the parameter. The Databank file and field name appear in the parameter node of the script tree.

The variable appears in the Code view in the http.param parameters of the http.querystring parameter:

Use the Playback iterations to playback using the records in the databank. You can also use custom code to loop through databank records and assign values to variables.

Configuring Databanks

You must configure the databank to use with a script before you can get records from the databank to use in a script.

To configure databanks to use with a script:

  1. Open or create a Script project.

  2. Select Configure Databank from the Script menu.

    This dialog box lets you configure the databank files used with the script.

  3. Click the Add button.

    Add: Opens a dialog box for selecting a databank file to add to the script.

  4. Enter the databank file name or click Browse to select the databank file.

    • Databank: Shows the name(s) of the comma-separated value databank file(s) added to the script.

    • Browse: Opens a dialog box for selecting the path and file to use as the databank.

    • Edit: Opens the selected databank file.

    • Delete: Deletes the selected databank file from the script. The file is not deleted from disk.

  5. Enter an alias name to use for the databank or leave the default alias name. The default alias name is the name of the .CSV databank file.

    Alias: Specifies an alias name to use for the databank. The databank file name is the default. The databank alias name is the name that appears when you add a databank record retrieval node to a script tree.

  6. Click OK.

    The following information appears after a databank file has been selected:

    • Line numbers: Shows the line number of the databank record.

    • Column Headers: Shows the field name(s) used in the databank file.

    • Rows: Shows the data values specified for each record in the databank.

Databank files are comma-separated value files. The field names are on the first line of the file separated by commas (no spaces). The field data is on subsequent lines separated by commas (different line for each record, no spaces around commas). The following shows an example:

FirstName,LastName,Mail,Phone

John,Smith,JohnS@company.com,x993

Mary,Ellen,MaryE@company.com,x742

If a data value contains a comma, place quotation marks around the value, as follows:

John,Smith,"Anytown, MA","(603) 993-0000"

Getting Databank Records

To get databank records to use with a script:

  1. Open or create a script project.

  2. Configure the databank to use with a script.

  3. Select the script node where you want to use the databank record.

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

  5. Expand the General node and select Get Next Databank Record.

  6. Click OK.

  7. Select the databank alias to specify the databank file to get the record from.

  8. Click OK. A GetNextDatabankRecord: databank alias node will be added to the script.

  9. In the Java Code view, the getDatabank("databank alias").getNextDataBankRecord() method will be added to the script code:

    getDatabank("customer").getNextDatabankRecord();
    
  10. Add your custom code to create an array variable to retrieve data from the databank record.