Openscript test data parmeterization with databanks

Openscript test data parmeterization with databanks
Like Tweet Pin it Share Share Email

As you all know the main purpose of creating automation test scripts is to run the scripts for multiple sets of data and increase the test coverage with several combinations of test data, while there are several ways to parameterize scripts in Oracle Application testing suite, this article limits to knowing as how to parametrize openscript scripts using Databanks.

Assuming that you know how to record a script using openscript, once you have recorded a specific test case in openscript, first thing you need to identify is what are all the input data that you want to parametrize so that the same script can be executed repeatedly for different sets of test data.

Just to keep the understanding easy & clear, let me explain you with an example here:

You can navigate to signup page of developer.salesforce website you would see a registration page as below:


There are 9 input fields in the above registration page, but as per this test case let us consider that, you want to run this test case for registering only developers from India residing in a specific Postal Code. So when you consider this scenario, there is no use of parametrizing test data for fields like “Role“,”Country“,”Postal Code” and checking the checkbox to accept agreement as they remain constant as per the above consideration.

Now we are left with the following fields, which could be parametrized for executing the scripts for multiple sets of test data.

  • First Name
  • Last Name
  • Email
  • Company
  • Username

Let us first see how the script looks when creating  a script to register in the above website:

Script Before Parameterization

Now, in order to parametrize the fields as per above, perform the below steps:

Steps to add a CSV File based databank @ openscript for test data parametrization

  • Click on “Assets” tab of the script’
  • Select Databanks in the tree
  • Click on Add button on the right side of the window
  • Select “CSV File” option


  • Navigate to desired folder location as where you want to store the databank.
  • Give a name for example “register-test-data” and click on OK Button.


  • Select the newly created databank in “Assets” tab and click on “Open” Button
  • You will be presented with a plain text editor in the openscript IDE.
  • Now, enter the field names you want to parametrize with comma separated names i.e. firstname,lastname,email,company,username
  • Note: the first row in this file is considered as parametrized names for these fields.
  • Now you need to give multiple sets of data that you want to use for registering the website as below:


Now that you have successfully created a databank for this script, lets follow the below steps to parametrize the script with this databank.

Steps to parametrize script using the CSV File based Databank

  • Navigate to “TreeView” of the script.
  • Double click on “first_name” field in the treeview


  • You will be presented with a window by name “Set Text” which contains the first name that you have given during the time the script was recorded.


  • Now click on parametrize-cion  icon to parametrize the data
  • You will be presented with a window “Substitute Variable”


  • In that window you can see a databank with name “register-test-data” that you have created some time back.
  • Select “firstname” and click finish.


  • You can now see that an expression is inserted in the place where data was present earlier.


  • Click OK button.

There it is you are done with parametrization of firstname field, repeat the same steps to parametrize other fields and you would be done with test data parametrization as below:


You are all set now with test data parametrization for the desired fields, in the above example we have given 2 sets of test data in the CSV file based databank, in order to execute this script for all test data sets, you need to click on iterate (iterate) button in the openscript IDE and not the normal playback button and click on “OK” button when you are presented with “Iterate” window. The default settings in this window is the execute for all sets of test data provided in databank.

In case of any queries, please feel free to reach out to me through comments, I would be more than happy to assist you in this.


Comments (8)

  • That is an amazing work!
    Thank you so much for your time
    I have a question that how we can restrict iteration on the specific group? Because on each iteration, it is being started from the 1st group of the tree.

    • Author

      Hi Faisal,

      Thank you so much for reaching out to us on iterations in Oracle Applications Testing Suite, could you please elaborate your query, as what do you mean by specific group???

      If you were referring to step group, there is no direct way of doing it, but you could write your own logic to understand which iteration the script is currently executing and then you can write some conditional logic to only execute those groups which you want to get executed, hope this clarifies your query.

      Please do let me know if you have any further queries, I would be more than happy to help you.

      Srinivas P.

  • Hello,
    I follow what you said. Its Amazing. But i have a query that if i have up to 20 Records in Single Data bank of a Script and i started running Script. If my 2nd record of that data bank has wrong values and it got failed. So i want a logic by which if 2nd Record have failed it have to continuous to run 3rd record up to 20th records
    Is that possible

  • This is more clear. Thank you
    i have a quick question.Is there any method/per-defined option to set value back to .csv file using databank?

    • Author

      Unfortunately there is no pre-defined methods available for this purpose, but you can try POI Library for this specific need.

  • Hi Srinivas,

    I am working on Openscript. I want to know how to get the value of a particular input parameter while using .csv file as an input data sheet.
    I tried using below code to get the value of username but it returns as null
    String username = getVariables().get(“Username”);
    info(“Username: “+username);
    Username: null
    even though i have provided the value in input data file(.csv)

    • Author

      Hi Sushma,

      First thing, in order to access data from databank, we cannot use getVariables().get(“Username”); there is another API if you want to retreive data from databank.
      It should be something like below:

      String username = “{{db.dbaliasname.colname}}”;

      Also, is it possible to share
      1. CSV file contents
      2. The way you associated the csv file as a databank.

      In case you followed the steps carefully in this article, once you are done with all the steps, click on “Code View” and you can actually see the equivalent code, for connecting to databank, retrieving data from databank.

      I hope this will give you a direction.

      Thank you,
      Srinivas P.


Leave a Reply

Your email address will not be published. Required fields are marked *