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

how to insert QTP to display errors and other description in the test results instead of halting execution by throwing error in the mid of executin due to an error (for object not found)?

1 Answers   Ordain Solutions,


how to compare two bitmaps( 1. clients requirement & 2. Designed by dev) in qtp 8.2 wann clear steps

0 Answers  


what is the data driven testing?

0 Answers  


Explain about the Test Fusion Report of QTP?

1 Answers  


How to modify object property in qtp ?

0 Answers  






How to findout the number of spaces with in STRING For Ex : STRING is " RAJ IS A SOFTWARE ENGINEER " Please send me the answer

3 Answers  


How to integrate QTP with QC using VB Scripting? What are the prerequisites to connect with QC?

0 Answers   CTS, Nabard,


how to idetfy which test cases are automated?who will deside that plz tell me

0 Answers  


action contains public and private functions but do we resuable that action or not..If it is reusable How..plz tell me the ans

0 Answers   TCS,


What are the challenges you faced during you entire life automation ?

0 Answers   Tech Mahindra,


I want to write some certification courses, so friends could you guide me? which certification is best and how to write exam and what tutorials need to be studied,what to do first, I am working on automation tool QTP 9.2

0 Answers   Livetek,


Reverse a string keeping the words in the string as it is. E.G. "Quick Test Professional" O/P "Professional Test Quick"

5 Answers   Cap Gemini,


Categories