When we design a test automation framework in qtp, we usually store the test data inside excel sheets.
Sometimes we need to load the test data in datatable to execute the test cases.
We can either import all excel sheets from excel workbook or we can import particular excel sheet from the the workbook to the datatable
'to import all sheets from excel file, use below line of code
datatable.Import "c:\abc.xls"
'to import single sheet from excel file, use below line of code
'here we are importing the sheet global from abc.xls into testdata sheet in datatable in QTP.
datatable.AddSheet "testdata"
datatable.ImportSheet "c:\abc.xls","Global","testdata"
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.
Sometimes we need to load the test data in datatable to execute the test cases.
We can either import all excel sheets from excel workbook or we can import particular excel sheet from the the workbook to the datatable
'to import all sheets from excel file, use below line of code
datatable.Import "c:\abc.xls"
'to import single sheet from excel file, use below line of code
'here we are importing the sheet global from abc.xls into testdata sheet in datatable in QTP.
datatable.AddSheet "testdata"
datatable.ImportSheet "c:\abc.xls","Global","testdata"
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
No comments:
Post a Comment
Please Leave your reply. We value your feedback and inputs