![]() |
Perform iteration as per the number of files available in a folder - 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: Perform iteration as per the number of files available in a folder (/Thread-Perform-iteration-as-per-the-number-of-files-available-in-a-folder) |
Perform iteration as per the number of files available in a folder - rohit330 - 02-22-2012 Hi All, I am a newbie in QTP. I am trying to automate some part of my test. Please have a look on the following code. Code: Function readTextFromFile(pathToFile) In the above code, am reading a file and writing this to a variable "text". Then copying this to my application text area and submits. Similarly i want to read other files from this folder util the last file. Like this i have five folders. If i select option 1 in my application i have to read files from 1st folder, after that i have to select option 2 in my application and then folder has to changed to 2nd folder. Will i be able to include all these 5 otpions within a program or i have to write 5 different pgm. Do i have to use vb script or any QTP logic is there to iterate. I have aware of some terminologies like parameterization. Your time and advices are much appreciated. Thanks in advance all.. If am posting in the wrong thread, kindly pardon. Regards RE: Perform iteration as per the number of files available in a folder - inborntester - 02-22-2012 Code: ' assume that folder1, folder2, folder3, folder4, folder5 are the five folders located in the root folder c:\folder i attached the folder i used. remove all the msgbox codes, i have used for tracking purpose. RE: Perform iteration as per the number of files available in a folder - rohit330 - 02-27-2012 Hey thanks yaar...i used d above code with some modification...working fine now.. ![]() Best Regards |