Micro Focus QTP (UFT) Forums
how to create text file - 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 create text file (/Thread-how-to-create-text-file)



how to create text file - swayam - 05-28-2014

i want to create below text file. Can someone help

Condition : 1
Status : Pass
Test Condition : Enter username in username textbox.
Actual Result : UserName entered successfully.
-------------------------------------------------
Condition : 2
Status : <>
Test Condition : <>
Actual Result : <>
-------------------------------------------------
Condition : 3
Status : <>
Test Condition : <>
Actual Result : <>
-------------------------------------------------
Condition : 4
Status : <>
Test Condition : <>
Actual Result : <>


RE: how to create text file - basanth27 - 05-29-2014

I can guide you if at all you are interested to explore and learn further.

1. Look for 'FilesystemObject'
2. If you have understood point 1, you would know how to create a text file.
3. For your requirement you will need to 'append' the file as you are writing the results after every iteration.
4. If you have understood upto point 3, its a cakewalk from here. You write a function which creates a textfile and appends the data into it. call this function wherever you have to report and Voila ! you have what you need.

I am sure you would come across several frustrations when you are learning this, but believe me, its worth to give it a shot !