I have to import a Excel sheet into the datatable of QTP.
The excel is uploaded in attachment tab of the folder containing the test in Test Director
datatable.ImportSheet path1, "Sheet1", "Global"
it gives an error message :
The DataTable.ImportSheet operation failed. [QualityCenter] Subject\WEX MasterCard\Sample1.xls path does not exist.
But the file is existing in the given path
Try to copy the file to temp directory and then Load the datasheet from temp directory
I can do that by copying it into any folder on the local drive and load the sheet but my reqirement is to have the sheet in TD so the scripts can be executed from anywhere any machine.
We do the same. We store all our datasheets in Quality Center.But in order to load the datasheet to your test you have to copy the datasheet from QC/TD to local directory using script.
Better my suggestion.
create one environment file by user defined and attached environment file into the QC
for thin code u can write the constant like this
note: path it should be constant in environment variable
Thanks & Regards,
you cannot add dynamically from TD to QTP.
try this, might help you
re-design you data sheets
you need to add the spreadsheet at the begining.
test settings -->resources -->other location(add spreadsheet from quality center.
when things gets harder ,the harder gets going
If you have your Excel files in TD/QC, you can write a simple function to download the file for TD/QC to a local folder, then you can import the sheet into QTP
The are several postings in this forum that refer to how download an attachment from TD/QC.
If I remember it correctly there is a defect open for QC 8.0/8.2. It should be fixed in 9.0, but check with Costumer Support.