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

I used Child objects to get the count of the no of weblist present in the page.now i need to select the item in the weblist..Please send me full code

1 Answers  


Where is the Bitmap checkpoint information stored?

0 Answers   Ordain Solutions,


Explain the difference between smart identification and object identification withn clear example. please it is very urgent

2 Answers   Wipro,


Syntax for how to call one script from another? and Syntax to call one "Action" in another?

3 Answers  


Can you brief the hurdles you faced during Automation testing?

0 Answers  


How do we do DOM programming in QTP.Could you explain with an example. If possible please provide some material or link related to DOM Programming.

0 Answers  


Will down time for server and content maintenance/upgrades be allowed? how much?

0 Answers  


What VBScript operators, functions, and statements do you use in QuickTest Professional?

0 Answers  


How will you set a unique four digit number in an edit field in QTP?

2 Answers   IBM,


The Senario is Steps to do 1.Entered userid in textbox 2.saved with details 3.i want to open user which i have created its in hurry.....

1 Answers  


What is the short cut keys for the following?

0 Answers  


how we do database testing with qtp using descriptive programming?

22 Answers   Nutrins, Rohit Technologies, Symphony, Syntel, TCS,


Categories