How to create log file in qtp?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a script to validate the content in the web application. (do it by OR method) and (do it by Descriptive method by creating a description object.. (give a filter condition only WEbelement- not easy need to use some more property while giving filter condtions- use google for your help...))

1494


Dear All , For UFT 12.02 which version QC or ALM will support ? Thanks Balaji

911


Explain the concept of object repository & how qtp recognizes objects?

562


X flies from Hyd to bangalore using different methods of transportation. write the test scenarios and test cases for this?

1495


Explain the concept of object repository?

520






Explain the terms test and business component?

540


What test you perform mostly? Regression or retesting in your testing process?

567


When ‘option explicit’ keyword is used in qtp?

741


What is the synchronization point in qtp?

555


How did you resolve conflicts present in Object Repository?

1609


How do I lauch my test website using code from qtp in different environmet, uat and PPTE?

1451


What is the significance of “action 0” in qtp?

561


To retrive the test data which tool vl use and whats basis u vl write test data? its urgent

1437


if there is a web table of having row and colmns.a button is placed at 2nd row's 3rd column which is worked for both edit and delete..how to write script for the button to test both operation on the web table using desriptive programing.. plz help me on script wheather using getroproperty Q2)what is the command for taking valiue from a web table in qtp

23875


I used the below code to open QTP through VBscript?But i can unable to Invoke QTP...PLZ help me with the correct code to invoke QTP through VBS with description of the code aswell. Dim qtApp 'As QuickTest.Application 'Declare the Application object variable Dim qtTest 'As QuickTest.Test 'Declare a Test object variable Dim qtResultsOpt 'Declare a Run Results Options object variable Set qtApp = CreateObject("QuickTest.Application") 'Create the Application object qtApp.Launch 'Start QuickTest qtApp.Visible = False 'Make the QuickTest application visible qtApp.Open "C:\form", True 'Open the test in read-only mode 'set run settings for the test Set qtTest = qtApp.Test qtTest.Run 'Run the test 'WScript.StdOut.Write "Status is: " & qtTest.LastRunResults.Status 'Check the results of the test run qtTest.Close 'Close the test qtApp.quit 'Close QuickTest Pro Set qtResultsOpt = Nothing 'Release the Run Results Options object Set qtTest = Nothing 'Release the Test object Set qtApp = Nothing 'Release the Application object

2411