Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help: QTP and Excel
#1
Solved: 10 Years, 9 Months ago
Hi All,

I am trying to use excel to store all test data required for the scripts. In excel, the Sheet 1 contains data for all tests(Test1,Test2,test3,Test4 and so on....) as shown below.
The excel file is located in c drive. Now, if we import the sheet 'Sheet1' the complete sheet will be imported. But for the Test1 I need only Test1's data(the three patient records where the TestName is 'Test1')
So instead of importing the complete sheet, is there any way to import only the required records from the excel sheet?
Or after importing the sheet, and after getting sheet to the QTP run time data table using GetSheet method, can we query and read only the required rows?
________________________________________________________
TestName PatName MRN Age Address TPDataRef
__________________________________________________________
Test1 XX 123 20 Patient1
Test1 YY 234 14 Patient2
Test1 ZZ 456 56 Patient3
Test2 AA 678 90 Patient1
Test2 BB 987 80 Patient2
Test2 CC 234 10 Patient3
Test2 DD 679 3 Patient4
Test3 FF 777 40 Patient1
Test4 HH 444 36 Patient1
Test4 KK 555 29 Patient2


I tried with mdb file for other projects. It works. We can query and read the required data from mdb file. But, for this project, I need to use excel file. So please give me some inputs.

Thanks and Regards,
Pallavi
Reply
#2
Solved: 10 Years, 9 Months ago
in such case to import into datatable, you will have wirte statements to import the specific data applying filters while retrieving from excel that will be as good as working directly with the excel only, so I would like to recommend using excel directly.
yes, you can query excel as well, see if this post helps you
https://www.learnqtp.com/qtp-database-ch...ving-data/

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  excel macro to open QTP from excel karthik1979_us 1 10,916 11-07-2009, 02:57 AM
Last Post: geethwind

Forum Jump:


Users browsing this thread: 1 Guest(s)