Saturday, 22 June 2013

QTP :-Useful Datatable Methods

Data table methods are used for performing the operations on the runtime data table

1. Add- sheet: It is used for adding the new sheet for the runtime data table

Syntax: Datatable.Addsheet("SheetName")

Ex. Datatable.Addsheet("Sumit")




2. Delete- sheet: It is used for deleting a specified sheet from the run time data table

Syntax:
Datatable.Deletesheet("SheetName")
Datatable.Deletesheet(SheetID)


Ex. Datatable.DeleteSheet("Sumit")
Ex. Datatable.DeleteSheet(3)


3. Import: It is used for importing the data present in all the sheets in an excel file to the runtime data table
Syntax:
DataTable.Import("pathoffile")


ex datatable.Import("c:\esbbxl.xls") 



'4. Import Sheet: It is used for importing specified sheet of data from the excel file to the specified sheet in the runtime data table
'Syntax:
'Datatable.Importsheet “path of the excel file, source sheet id, destination sheet id”


datatable.ImportSheet "c:\esbbxl.xls",2,3 


//Imports 2nd sheet from esbbxl file  into 3rd sheet of datatable, i.e action 2 in our case.
1. Global
2.Action 1
3. Action 2 







 



 




No comments:

Post a Comment

Spring Boot : Exception Handler 14