In QTP, How to Import data from an external files (I want to display external file data's into Global Sheet)....?

Questions by JasmineRaj

Showing Answers 1 - 5 of 5 Answers

saranya

  • Dec 20th, 2006
 

 

The following command imports the excel data n to the data table.

FILE COMMAND:

Import From File

 It imports a tabbed text file or a single sheet from an existing

Microsoft Excel file into the table.

Imports an existing Microsoft Excel or tabbed text file into

the Data Table. This command will import all the sheets in

the selected Microsoft Excel file. If you want to import only

one sheet from an existing Microsoft Excel file, use the Sheet

>Import > From File command described below.

Notes: The table file you import replaces all data in all sheets

of the table, and the first row in each Microsoft Excel

sheet replaces the column headers in the

corresponding Data Table sheet. It is therefore

essential that the first row of your Microsoft Excel

sheet exactly matches the parameter names in your

test, and that the file contains at least the same

number of sheets as the current Data Table.

If you import a Microsoft Excel table containing combo box

or list cells, conditional formatting, or other special cell

formats, the formats are not imported and the cells are

displayed in the Data Table with a fixed value.

  Was this answer useful?  Yes

Natesh

  • Dec 20th, 2006
 

use

DataSheet.Import(filename)

where "filename" is the path of the  excel sheet which you want to import.

  Was this answer useful?  Yes

JasmineRaj

  • Dec 20th, 2006
 

But it's displaying only RunTime, after RunTime entire values are gone in DataTable....

I need ones Run is done after that, it should display Test Results as well as DataTable both the places....

Please give me an solutions

  Was this answer useful?  Yes

Anitha

  • Dec 22nd, 2006
 

first add the data sheet into the data table as 3rd data sheet.i.e.other than global,action,inorder to prevent from data crash.

use the following commands

add.datasheet('"sheet name")

import.datatable"give the path where data table is available","give sheet name if more than 1sheet is available","sheetname"

  Was this answer useful?  Yes

hi

in qtp we have the function called datatable.importsheet

datatable.ImportSheet "C:raja.xls",2,global

first parameter is path of the file, second parameter is in that file which sheet i.e. 2 means second sheet, third parameter is in our datatable which sheet u want in global sheet so i wrote global, if u want in action1 u can write there as action1 or that action name.

bhadra

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.