HomeOATS

Test data parametrization of Web Services script using OATS

Like Tweet Pin it Share Share Email

In the previous article you have learnt how to create a web services testing script using OATS, in this article let us see how to parametrize a web services test automation script assuming that you are aware of why test data parametrization is required for a test automation script.

There are couple of ways of parametrizing a web services test automation script using OATS – Oracle Application Testing Suite, but in this article you will learn how to parametrize script with Openscript IDE of Oracle Application Testing Suite / OATS.

Step by Step Instructions to parametrize web services testing script

In the Openscript IDE

  • Click on Assets tab
Navigate to Assets Tab
Navigate to Assets Tab

  • Select Databanks and click on Add > CSV File
CSV as Databank
CSV as Databank
  • Give a Databank name (preferred path is the place where the script resides) in the Databank Folder Window and click Ok Button
Databank Name
Databank Name
  • Select the newly added databank and click on open
Open Countries Databank
Open Countries Databank
  • A window opens, here you can give first row as the header columns for your databank, i.e. to understand what test data to be given, first row will contain all the header columns, for example in this script, we can give as “CountryName” as header column, you can also add multiple headers based on need to be able to input multiple test data, these headers are separated with a comma delimiter as this is a csv file.
  • All the rows below this header row will become the actual test data, you can give multiple test data rows in each row, for this example give United States and India in 2 different rows as below
Databank with 2 rows of test data
Databank with 2 rows of test data
  • Click on Save
  • Go back to Tree view of the script
  • Double click on the post data node
Post Data Node
Post Data Node
  • Expand till we get the input parameter for your method, which you want to invoke as part of the web service execution.
Post Data Dialog Window
Post Data Dialog Window
  • Select the row and click on the Substitute variable icon Substitute Variable Icon.
  • Now you can see the databank and the headers provided in the csv file will be listed to select as which header column to be considered as input for this field in the script.
Select Databank Header Column for test data
Select Databank Header Column for test data
  • Select “CountryName” and click on Finish button of the Substitute Variable Dialog Window, Click on OK button of “Post Data” Dialog window to complete the parametrization option
  • Click on Save of Openscript IDE
  • Now you have successfully parametrized this small webservices script and be able to run for 2 different sets of data which is “United States” and “India”
  • Now you have to run the script for all test data records given in the databank, you can see 2 icons in the tool bar playback icon  playback icon and iterate icon Iterate icon.
  • For the script to run for multiple iterations, you need to click on iterate icon and provide data as below screenshot and click on OK button to trigger the execution.
test data iterate options
test data iterate options
  • The script now runs for two rows of test data and gives the result steps for 2 iterations, click on the results and select the current result and check the Details View, you can see that it shows 2 Iterations, expanding those further you can see different test data is been used for the 2 iterations and has separate results steps for the same.
Iterate Test Results for 2 iterations
Iterate Test Results for 2 iterations
Iterate Test Results for 2 iterations in Details View
Iterate Test Results for 2 iterations in Details View

Please do leave your queries as form of comments, I would be more than happy to help.

Comments (4)

Leave a Reply

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