Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - How to use import and export sheet methods in qtp?




538
views
asked marvit August 26, 2014 02:15 AM  

How to use import and export sheet methods in qtp?


           

1 Answers



 
answered By Dharma   0  
⇒Import Method:

Description: Imports the specified Microsoft Excel file to the run-time Data Table.

Syntax: DataTable.Import(FileName)

Example given below


⇒Export Method:

Description: Saves a copy of the run-time Data Table in the specified location.

Syntax: DataTable.Export(FileName)

Example:

'If data is stored in multiple  sheet  in  external Excel  Workbook  ,
'we can import  multiple sheet  data into Datatable and 
'Do neccessary operation on the imported data.
datatable.Import  "C:\qtptest.xls"

'To get the total count of QTP datatable sheets
msgbox datatable.GetSheetCount

'After the operations are done,you can export the all the qtp datasheets to the External file
'Create a datatable sheet during Run time.This sheet will be available during  run time only.
datatable.Export  "C:\qtptest.xls"

'We can view  this sheet  in Result Summary  under section "Run Time data Table"  .
datatable.AddSheet("Qtpworld")
 
'To delete   datatable sheet
datatable.DeleteSheet("Qtpworld")

datatable.DeleteSheet("Global")
 
wait 3
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


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!

Alert