Working with datatable is very common in QTP.
We use datatables to store the runtime data.
The biggest disadvantage of datatable is that it is a temporary storage which means that data stored in datatable is removed when test execution is over.
If you want to reserve the datatable data, you can export the data to excel sheet so that you can use it later on.
Examples -
'Add some data to global sheet in datatable
datatable.GlobalSheet.AddParameter "p1","v"
datatable("p1") = "abc"
'Export complete datatable - This will export all sheets from the datatable
datatable.Export("c:\abc.xls")
'export only particular sheet from the datatable to excel sheet
'after below code is executed, sheet with name global will be exported to excel sheet in kk.xls
datatable.ExportSheet "c:\kk.xls","Global"
You may find below links very useful if you want to know more about data tables in QTP.
Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.
We use datatables to store the runtime data.
The biggest disadvantage of datatable is that it is a temporary storage which means that data stored in datatable is removed when test execution is over.
If you want to reserve the datatable data, you can export the data to excel sheet so that you can use it later on.
Examples -
'Add some data to global sheet in datatable
datatable.GlobalSheet.AddParameter "p1","v"
datatable("p1") = "abc"
'Export complete datatable - This will export all sheets from the datatable
datatable.Export("c:\abc.xls")
'export only particular sheet from the datatable to excel sheet
'after below code is executed, sheet with name global will be exported to excel sheet in kk.xls
datatable.ExportSheet "c:\kk.xls","Global"
You may find below links very useful if you want to know more about data tables in QTP.
- How to export datatable sheets to excel
- How to import excel-sheet to datatable
- How to read value from cell in datatable in QTP
- Explain setcurrentrow method in qtp
- Datatable object in qtp
- How to export datatable to excel in qtp
- How to get current sheet from datatable
- How to check if parameter exists in sheet in datatable in qtp
- Explain dtsheet object in qtp
- What are the utility objects in qtp
Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.
No comments:
Post a Comment
Please Leave your reply. We value your feedback and inputs