how to read log file using QTP??

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

please post the interview questions for QA position in FACTSET

3940


Hi , I am facing issue QTP 10.0 with oracle ERP 11i .When QTP opens,click sub links on ERP ,FORM is not opening getting unexpected Internet explorer error message with send or don't send report.So unable to work with forms using QTP.

3413


what are the critical test cases in crm? tell me atleast 5 critical test cases? what are the critical bug u find out while testing crm domain?

2734


what frame work you are following?

1520


Can any one brief some detail on how the shared and action object repository utilized/implemented in a real time project. I already know how to make shared object repositor by saving OR as .tsr extension..I wanted the actual concept of implementation...couple of live examples will be highly appreciated. Thanks

1893






Why qtp always start action1 and does not start action?

596


what is key word driven frame work ? why it is called like that ? what is the diference between keyword driven and data driven frame work ?

1543


For the below written code , i want to be stop the loop (ex:10 times), but it is focusing to first line of the code & generating error. vbwindow("vbname:=frmMain").Type micAltDwn + "6" + "2" + "D" +micAltUp 'wiil open the particular window in application vbwindow("vbname:=frmDeduction").vbbutton("vbname:=cmdNew").Click DataTable.ImportSheet"F:\QTP VBScript\Form 26-1.xls","Deduction",Global RowCount = DataTable.GetSheet("Global").GetRowCount i=RowCount For j =1 to i 'vbwindow("vbname:=frmDeduction").WinObject("nativeclass:=DataComboWndClass","abs_y:= 187").Type DataTable("Name", dtGlobalSheet) vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 187").Type DataTable("Name", dtGlobalSheet) vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 187").Type micF4 vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 187").Type micTab vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 216").Type micF4 vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 216").Type DataTable("Section", dtGlobalSheet) vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 216").Type micTab vbwindow("vbname:=frmDeduction").VbEdit("vbname:=txtAmtOfPay").Set DataTable("Amount_of_Payment", dtGlobalSheet) vbwindow("vbname:=frmDeduction").VbEdit("vbname:=txtAmtPaidDate").Set DataTable("Amount_PaidCredited_Date", dtGlobalSheet) vbwindow("vbname:=frmDeduction").VbEdit("vbname:=txtAmtPaidDate").Type micTab vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 316").Type micF4 vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 316").Type DataTable("Deduction_is", dtGlobalSheet) vbwindow("vbname:=frmDeduction").ActiveX("acx_name:=DataCombo","abs_y:= 316").Type micTab vbwindow("vbname:=frmDeduction").VbButton("vbname:=cmdSave").Click DataTable.SetNextRow Next vbwindow("vbname:=frmDeduction").VbButton("vbname:=cmdClose").Click

2636


How to give a call to another action from one action?

622


Is QTP supports Unix. If yes, then how the test automation is done?

1720


I am getting an error "failed to open the XML checkpoint result viewer" in result window,after clicking on "View XML checkpoint results".Someone suggest me settings,if any...

1455


How is UFT 11.5 version different from UFT 12.0?

602


what are the limitations of smart identification in qtp 9.0

1917


Hi, is it possible for recording shortcut key during record session? The application on which I am working is web based application. This application has several shortcut key associated with menu option. I have succesfully recorded all menu option but unable to record shortcut key.

1383


When we r doing data driven test with chkpts, i want to insert formulae in data sheet but i didn't get. How we wil do that plz. explain in detail.

1597