gp


{ City }
< Country > india
* Profession *
User No # 31970
Total Questions Posted # 1
Total Answers Posted # 1

Total Answers Posted for My Questions # 2
Total Views for My Questions # 6059

Users Marked my Answers as Correct # 9
Users Marked my Answers as Wrong # 1
Questions / { gp }
Questions Answers Category Views Company eMail

We have one Package(which has many function/procedures, SQL quires etc). Now we need to check, which query or procedure is taking lot of time in that Package. ? How do we do it.

IBM,

2 Oracle General 6059




Answers / { gp }

Question { 8564 }

How to use Text file (Notepad) as ur data source in QTP?
Can u please provide some function code for it?


Answer

For this you need create File system object.
Below code is for reading from text file


Const ForRead=1

Dim objFSO, objFile, strText
Set objFSO = CreateObject("Scripting.FileSystemObject")

'Reading code
Set objFile=objFSO.OpenTextFile("z:\filetext.txt", ForRead)
Do until objFile.AtEndOfStream

strText=objFile.ReadLine
msgbox strText
Loop

objFile.close

Set objFile = nothing
Set objFile1 = nothing
Set objFSO =nothing

"strText" variable will now contain data from text file.

Is This Answer Correct ?    9 Yes 1 No