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 do you do batch testing in wr and is it possible to do in qtp, if so explain?

0 Answers  


WHAT IS PARAMITARIZATION?

8 Answers  


Write a script to print below pattern 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5

9 Answers  


How open an excel sheet in QTP(not a run time )?

4 Answers   Tech Mahindra,


How do you handle multiple banners(at the top the page, the banner is scrolling) in a web page(Dont take the name property(regular expression))

0 Answers   CFC, iton,


How would you directly trigger javascript in a test?

0 Answers   eBay,


hi friends can any one provide me the project in qtp because i have to attend to interview within one week atleast you provide the website address which provide the qtp projects

2 Answers  


Hi all, i have installed QTP8.2 in my system. but script is not generating while recording. What is the problem? is any file missing? pls let me know anybody...Thnaks

3 Answers  


What is the difference between low level recording and virtual object.

2 Answers   Tech Mahindra,


how to merge object repositories?

4 Answers  


Out of 3 recording modes. 1.Standard 2.Analog 3.Low-level, which one is commonly used. As per my knowledge, Analog is used for Graphs , barcoding or DIgital signatures.

0 Answers  


what is On Error Resume Next ?

1 Answers   Accenture,


Categories