How to create log file in qtp?

Answers were Sorted based on User's Feedback



How to create log file in qtp?..

Answer / naveen

Using CreateTextFile method of File System Object property.
we can create a log file and write the data into it.

Sub CreateAfile
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("c:\testfile.txt", True)
MyFile.WriteLine("This is a test.")
MyFile.Close
End Sub

Is This Answer Correct ?    7 Yes 4 No

How to create log file in qtp?..

Answer / keerthykannan

Dim fso,objLogFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set objLogFile = fso.OpenTextFile ("C:\Log" &var
&".txt",2,true)
objLogFile.Writeline(time)
objLogFile.Close

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More QTP Interview Questions

How the smart identification is used in real time?Please explain with an example

0 Answers   Wipro,


difference Between LowLevel and Normal Recording Modes?

4 Answers  


HOW DO U CALL A ACTION IN QTP?

2 Answers   BirlaSoft,


Explain the benefits of quick test pro(qtp)?

0 Answers  


what is object repository size?

22 Answers   ITC Infotech,






How to connect to data base?

2 Answers  


suppose there r 10 action in a test i want to execute action 5 to 10 how would i do that

2 Answers  


Plz send one Tracebilitymatrix example? Anybody working on Realtime QTP Plz give contact deatils?

1 Answers  


i have 2 year experience in manual and automation testing, I have less percentages in X, Xii (Second grade), can i elgible to TCS interview (Or MNC's)

3 Answers  


what is the extension for QTP files?

16 Answers   American Solutions,


How to use the object spy in quicktest professional (qtp) 8.0 version?

0 Answers  


What are the Test design techniques you uses in ur project?

0 Answers   Accenture,


Categories