Micro Focus QTP (UFT) Forums

Full Version: how to create text file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 : <>
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 !