Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP DataTable.Import Issue
#1
Not Solved
Hi,

I am trying to import data from xls file using DataTable.Import statement.

But while running it is executing for first row only.
eg: if my xls contains 4 rows then it will run 4 times for first row only.

Settings:
In run settings I have selected "Run for all rows" then also same pronlem

And I have tried below mentioned code also but I can not use that becuase I am using Recovery Scenario, in which I am closing all browser & giving "Proceed to next iteration"
rowcount = Datatable.Getrowcount
For i = 1 to rowcount
Datatable.SetCurrentrow(i)
****Code*****
Next


Thanks & Regards,
Neha Singh
Reply
#2
Not Solved
If you have imported the sheet as local sheet check your Action call properties.
Reply
#3
Not Solved
Hi Prafulla,

Thanks for the reply.
I am importing in Global sheet only.

Thanks & Regards,
Neha Singh
Reply
#4
Not Solved
Please upload the code
Reply
#5
Not Solved
I had the same issue. Never could figure it out. What I found was that it would only run the same number of rows you had in the design environment data tab. If I had 3 row there regardless of how many I imported, it would only run 3 rows.

I ended up doing the following.
Code:
Dim x, rowcount
    rowcount = DataTable.GetSheet("Sheet1").GetRowCount
    'set row and get data
    For x = 1 to rowcount
            DataTable.SetCurrentRow(x)
        'do your processing here

    Next
Reply
#6
Not Solved
hey did u find the solution for the above issue you dicussed, I'm facing the same problem. Can you help me out please.
I Have 4 rows,when i Used datatable.import, then it will run 4 times for first row only
I tried
Code:
rowcount = Datatable.Getrowcount
For i = 1 to rowcount
Datatable.SetCurrentrow(i)
"test script"
Next
it is running on four rows but the for loop is exceuted for four times.
Reply
#7
Not Solved
Hi,

Go to File>>Settings>>Run and select Run one Iteration Only

Regards,
Parminder
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  DataTable Import or Excel Object Automation_learner 1 1,741 11-15-2017, 03:56 PM
Last Post: Ankur
  Getting unexpected Pop up message while using Datatable.import Punam K 2 3,995 08-20-2011, 08:48 PM
Last Post: Arul
  Code to export and import tests in qtp tpragnya 0 2,958 08-17-2011, 08:06 PM
Last Post: tpragnya
  how to import xls file from qc frebuffi 0 3,129 04-27-2011, 07:38 PM
Last Post: frebuffi
  Import automated test cases from Excel VladVin 0 3,954 09-09-2009, 01:09 AM
Last Post: VladVin

Forum Jump:


Users browsing this thread: 1 Guest(s)