Oracle® Application Testing Suite OpenScript User's Guide Version 9.01 for Microsoft Windows (32-Bit) Part Number E15488-02 |
|
|
View PDF |
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.
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:
Any user entered input data (i.e. parameterize the data I entered for the search field)
Test case values (i.e. parameterize a text string for validation so I can use different inputs for comparison during playback)
Recorded navigations (i.e. parameterize a starting navigation so I can navigate to different host servers during playback)
Recorded user actions/object identified (i.e. parameterize a link object path so I can click on different links during playback)
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()
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.
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:
Open or create a Script project.
Select Configure Databank from the Script menu.
This dialog box lets you configure the databank files used with the script.
Click the Add button.
Add: Opens a dialog box for selecting a databank file to add to the script.
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.
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.
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"
To get databank records to use with a script:
Open or create a script project.
Configure the databank to use with a script.
Select the script node where you want to use the databank record.
Select the Script menu and then select Other from the Add sub menu.
Expand the General node and select Get Next Databank Record.
Click OK.
Select the databank alias to specify the databank file to get the record from.
Click OK. A GetNextDatabankRecord: databank alias node will be added to the script.
In the Java Code view, the getDatabank("
databank alias
").getNextDataBankRecord()
method will be added to the script code:
getDatabank("customer").getNextDatabankRecord();
Add your custom code to create an array variable to retrieve data from the databank record.