Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - Where to use DATA TABLE METHODS in Qtp? What is the use of it?

asked marvit August 19, 2014 12:25 AM  

Where to use DATA TABLE METHODS in Qtp? What is the use of it?


1 Answers

answered By Dharma   0  
Datatable Object and related Functions: Basic use of Datatable object is to create an object for adding, deleting, updating data of an excel sheet used. Main functions of the datatable object:

 Importsheet : This function is used to Import sheet into the script, so that all the data in the imported sheet can be used in the script.

Datatable.Importsheet(“nameofExcelfilewithpath”, “nameofthesourcesheet”, “nameofthedestinationsheet”)

    Exportsheet : This function is used to Export sheet from the script, all the data including output values are stored in the default sheet for the action, this sheet is exported and stored in a specified location using this function.

Datatable.Exportsheet(“nameofExcelfilewithpath”, “Nameofthesheet”)

    Addsheet: Used for adding a sheet into the script file
    GetRowCount: This function is used to get the no of rows in a particular sheet. Syntax: Datatable.AddSheet(“Sheetname”).GetRowCount
    GetCurrentRow: This function is used to get the current row of a particular sheet.

When an action is run by using run setting as “run on all rows”, that action will run as many times as the number of rows in the excel sheet of the action, in order to find the row for which action is running currently we use GetCurrentRow function.

Syntax: Datatable.GetSheet(“Sheetname”).GetCurrentRow
   add comment

Your answer

Join with account you already have



Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!