How to open a text file through VB scripting.? - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: How to open a text file through VB scripting.? (/Thread-How-to-open-a-text-file-through-VB-scripting) |
How to open a text file through VB scripting.? - qtplearner88 - 06-18-2012 HI, The AUT which I have a tree structure. it is a very big one. So What I am planning is to give the names of the links in that tree structure with a unique identifier in a text file with a variable that links the element. ie, For eg: In text file I wl give for one link "Photos" as scn_pic<space>Photos<space>a Here scn_pic is the unique ID and Photos is the name and a is the variable that tells me this is the link where I have to click. So in that way I wl be linking the whole tree structure with a variable. The variable a should be given as a parameter in the test case through an excel. Actually I want to open this text file and parse it to get the info required. Can anybody help here to get me a QTP vb scripting. Or please suggest a different way. Thanks Vivek RE: How to open a text file through VB scripting.? - qtplearner88 - 06-19-2012 Hi All, Please let me know if I have to provide more info on this. Kindly help me.. Thanks Vivek RE: How to open a text file through VB scripting.? - ravs@788 - 06-22-2012 Hi Vivek, Not sure if I understood your query correctly. But let me give it a try. You intend to store the link name in a text file and then parse the text file to get the detail and then use it to identify the link. If this is what you intend to do, you can try the following piece of code. '************************************************************************ Code: Option Explicit '************************************************************************ Let me know if this is what you intended to do and if this works as you expect it to. The input file is in the following format as you had specified. unique_id1 Link1 A unique_id2 Link2 B unique_id3 Link3 C unique_id4 Link4 D unique_id5 Link5 E unique_id6 Link6 F unique_id7 Link7 G Thank You, Ravi Shankar |