08-11-2010, 09:47 AM
Hi Dinu,
We can solve your issue by following the below steps.
1. Import the Excel to QTP using [Datatable.Import "File Path"]
2. Find the row count in excel using [Datatable.GetRowcount]
3. Use the for loop to fetch the data from the excel [For temp=1 to rowcount Step 1
Datatable.setcurrentrow(temp) 'to fetch the corresponding row record i.e temp
4. Pass the value to windows object.
Ex: You have a object WinEdit to insert data then follow as per the below code.
Note: Here "Parameter Id" means column name in excel
Sheet Id means from which sheet you are fetching the data.
Please let me know for further clarification.
Regards,
Venkat.Batchu.
We can solve your issue by following the below steps.
1. Import the Excel to QTP using [Datatable.Import "File Path"]
2. Find the row count in excel using [Datatable.GetRowcount]
3. Use the for loop to fetch the data from the excel [For temp=1 to rowcount Step 1
Datatable.setcurrentrow(temp) 'to fetch the corresponding row record i.e temp
4. Pass the value to windows object.
Ex: You have a object WinEdit to insert data then follow as per the below code.
Code:
Datatable.Import "File Path"
intrcount=Datatable.GetRowcount
For temp=1 to intrccount-1 step 1
Datatable.SetcurrentRow(temp)
Window("xxxxxxxxxx").WinEdit(xxxxxxxxxxx").Set Datatable.Value("Parameter Id","Sheet ID")
Next
Sheet Id means from which sheet you are fetching the data.
Please let me know for further clarification.
Regards,
Venkat.Batchu.