How can we program using QTP to generate a text file which has data inside in a particular format which also needs to be programmed using QTP ?

Showing Answers 1 - 1 of 1 Answers

rachana

  • Oct 10th, 2006
 

Dim fso, fhdl, msgstr '  variale to manipulate filesystem object , file handle , 'message details to be logged

  

 msgstr =  "TestCycle Date/Time -->" +cstr (date)& " - " & cstr(Time) & NewLine &_
        "TestScript Name " +  " APA_AdminLogincheck" & NewLine &"TestCase Id 00003" & NewLine &_
          "Details :  " &errstr1 & NewLine & "Result--> "  +  "Pass" & NewLine &_
         NewLine & "---------------------------------------------------------------------"  & NewLine  ' data inside the file is passed as parameter

   'create and open the file object
Set fso = CreateObject("Scripting.FileSystemObject")
Set fhdl = fso.OpenTextFile("c:Log.txt", 8)


' write to log file
fhdl.write(msgstr)

fhdl.close()

try this script. the format is defined through msgstr variable. You can modify according to your requirements

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions