Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My system is getting struck when i import excel sheet to the QTP runtime DataTable
#1
Not Solved Shy 
Hi

Here I am facing issue im importing a excel sheet to the new Runtime datatable sheet.

Here is the detailed information with script

1) Testcases.xls contains two sheets....
2) Opened the blank QTP test
3) Imported the Testcases.xls file to the QTP using the script: Datatable.import "C:\Testcases.xls"
4) Added one more sheet to the runtime datatable using the DataTable.AddSheet "Sheet1"
Now we have three sheets in the Runtime Datatable(one is Global, second one is Action 1 and 3rd one is Sheet1)
5) Tried to import sheet to the QTP Runtime Datatable uisng the script

DataTable.importSheet "C:\DataTable.xls",1,3

Here is the problem, i am not able to proceed further...I don't know why it is giving problem.

Other information is : i am using the QTP10.0 and Licensed version.

Please help to solve this one.

Regards
Mani
Reply
#2
Not Solved
Hi Mani,

Thanks for such a detailed post, it helps to understand the exact issue. If you want to import an Excel file in your Datatable.
Just do the two steps
1. Add a sheet to your datatable
2. Import the sheet you want from the excel file

Try this
Code:
Datatable.AddSheet "Sheet1"
Datatable.ImportSheet C:\Testcases.xls",1,3

In your mentioned steps I can see you have imported the excel in line 3
if you do a Import, the imported xls replaces all data in the existing run-time Data Table (including all data sheets).
also the files mentioned are different, I beleive you need to use the file mentioned earlier.

Hope this helps, let me know there is any issue.
Sorry, I misunderstood, I beleive you are preparing the datatable by importing the sheet.
just noticed that you have taken a blank test.

this is working fine when I tried. I doubt there must be some issue the DataTable.xls.

Reply
#3
Not Solved
Hi Saket,

Thanks for your Quick reply,

I can follow the steps mentioned in your reply if i am using the single excel file which has 3 sheets but i want to use both the excel files at a time.

When i imported both the files, the first two Runtime Datatable sheets contains the Testcases information and the 3rd sheet contains the test data information.

I have a automation framework; in that, at the Beginning of the script execution the script will imports the First Excel sheet.

In the middle of the execution or whenever is required i have to import a particular sheet to the Runtime DataTable 3rd sheet.


Thanks
Mani,
Reply
#4
Not Solved
Mani - Is it possible for you to attach the excel files? I would like to try out with them.

Reply
#5
Not Solved
Ensure this is correct or not as saket said
DataTable.importSheet "C:\DataTable.xls",1,3
Reply
#6
Not Solved
Ram -
What do you mean by " Ensure this is correct " ??

Please post the complete solution if you have any.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Reading Global Sheet's DataTable Value Bhuvana 0 1,634 01-05-2020, 10:03 PM
Last Post: Bhuvana
  How to make QTP Script to work when system gets locked? ramkumarad 6 12,473 11-02-2017, 03:37 PM
Last Post: Divv
  Reading data from excel sheet serenediva 1 9,598 03-03-2017, 10:07 AM
Last Post: vinod123
  How import final calculated values by cell formula from Excel not the formula itself. qtped 1 4,852 01-17-2017, 04:05 PM
Last Post: sagar.raythatha
  Local System Monitor kbhargava505 0 2,522 10-16-2015, 12:52 PM
Last Post: kbhargava505

Forum Jump:


Users browsing this thread: 2 Guest(s)