how to read log file using QTP??
Answers were Sorted based on User's Feedback
Answer / jayant naikwade
Note:- Bu Using Import as well as export Method
Give path for .xls file on Root Directory in datatable
parameter as below.
p_strFile=jayant.xls
p_strFile1=jayant1.xls
strFile=DataTable("p_strFile",dtGlobalsheet)
strFile1=DataTable("p_strFile1",dtGlobalsheet)
DataTable.ImportSheet
strFile ,1 ,"acn_Dummy"
DataTable.ExportSheet strFile1 ,3
iTotalRows = DataTable.GetSheet
("acn_Dummy").GetRowCount
For i = 1 to iTotalRows
DataTable.GetSheet
("acn_Dummy").SetCurrentRow(i)
strMenuNm = trim(DataTable.GetSheet
("acn_Dummy").GetParameter("No").Value)
strAction = trim(DataTable.GetSheet
("acn_Dummy").GetParameter("name").Value)
Next
| Is This Answer Correct ? | 4 Yes | 0 No |
Log files is nothing but *.txt & *.xls files
How to read log file *.txt:
1). for ex file name is raju.txt.
set a=createobject("scripting.filesystemobject")
set b=a.opentextfile("File path",1) (1 for Reading,2 for
Writing,8 for Appending)
while b.atendofline <>true
c=b.readline
msgbox c
wend
2). for ex file name is raju.xls
datatable.importsheet "file path", Sourcesheet, destination
sheet.
msgbox datatable(column no, sheet name)
i think this is working properly
if u have any quarries please call me
9823257761, my mail id is raju.ippali@gmail.com
| Is This Answer Correct ? | 4 Yes | 2 No |
Normaly log files are of .txt format.
so to read .txt files try using FSO (file system object)
| Is This Answer Correct ? | 0 Yes | 0 No |
Flight reservation using input and output parameter script.
what is memory leakage?
16 Answers ITC Infotech, Panamax, TIT,
Does we use Classes and methods in realtime..?How wud we access methods in a class..?Thanq Guys..!
What is InStr()
How to handle Dynamically changing Objects in QTP?
How to see entire results at the same timeafter the batch run.. Cannot see the entire results at a time. Is there a easier way view everthing at same,as our batch file very large
Does QTP10 supports Windows 7OS +IE 9 combination? Which is the preffered combination ,Plz let me know?
What are the enhancements u did after recording ur script?
How can I check if a environment variable exist or not?
What is data driver in qtp? Where we use it?
In qtp is it possible to check broken links of a page?
What test cases can you automate using QTP?