DataTable



A Data Table provides a way to create data driven test. It is similar to MS Excel spreadsheets and can be used to run an Action multiple times. Data table has one global data sheet which is accessible to all actions and each action has its own private data table also known as local data table. 

Types of Data Table:
There are 2 types of data table
 i) Design time data table :   A data table during script design time is known as design time data table.
              Note: Any changes to this are saved when the script is saved.

 ii) Run-time data table:  The run time data table contains a copy of the design time data table when a script is executed. It may contain values that are changed during script execution and are presented in the test result summary
          Note: The changes made to the data table during run-time are not saved to design time data table.

Setting data table iterations:
          To run a test case for some number of iterations we need to set the iterations of global data table in the Test Settings dialog, which is invoked using File → Settings → Test Settings window  → Run ( tab ) → Select required data table iterations radio buttons.
          Note: We can set the iteration settings for an Action call by going into the keyword view and then right clicking on the Action and selecting Action Call Properties

Accessing a data from the data table:

          msgbox datatable("val")
          msgbox datatable.GlobalSheet.getparameter("val").value
          msgbox datatable.GlobalSheet.getparameter("val").ValueByRow(2)
          msgbox datatable.value("val",dtGlobalSheet)
          msgbox datatable.Value("val",1)
          msgbox datatable.LocalSheet.Getparameter("val1").ValueByRow(2)
          msgbox datatable.GetSheet(2).Getparameter("val1").ValueByRow(2)

Entering data into data table:

          datatable.value("COLUMN NAME",dtGlobalSheet)=VALUE

Contributed by: Vamshi Gowtham
m.vamsigowtham@gmail.com