Need help: QTP and Excel - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Need help: QTP and Excel (/Thread-Need-help-QTP-and-Excel) |
Need help: QTP and Excel - Pallavi - 11-11-2010 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 RE: Need help: QTP and Excel - Saket - 11-11-2010 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-checkpoint-part3-retrieving-data/ |