how to read log file using QTP??

Answers were Sorted based on User's Feedback



how to read log file using QTP??..

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

how to read log file using QTP??..

Answer / raju

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

how to read log file using QTP??..

Answer / dinesh1433

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

Post New Answer

More QTP Interview Questions

write progamming connecting QTP to database sql? this is question asked by interview? pls any answer this?

4 Answers   IBM,


How can we add regular expression for date field (dd/mon/yyyy)?

3 Answers   CTS,


How to fetch web elements count from Google Page which contains letter "e"

4 Answers  


In QTP how to interact tool and application build?

2 Answers  


how can we test the Triggers, Cursors, Indexes while doing Database testing in DTP??

0 Answers   ABC,






In qtp, explain what is crypt object

0 Answers  


What's Checkpoints for QTP?

1 Answers  


is it possible to change the date format like MM/DD/YY into DD/MM?YY through script in QTP

5 Answers   IBM,


How to capture all the data of a webtable, weblist and combolist using QTP?

0 Answers   ITC Infotech,


what is the difference between an Action and a function in real time

4 Answers  


How can I use Call dlls in QTP ?

0 Answers  


In Object Repository, two actions r there. Action1 name is A.tsr, Action2 name is B.tsr. Is it Possible? if Yes, what is the out put of A+B? if No, why?

2 Answers   Kanbay,


Categories