How to use Text file (Notepad) as ur data source in QTP?
Can u please provide some function code for it?
Answer Posted / gp
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 |
Post New Answer View All Answers
How will you get the exponent of the given number in vbscript?
How can you destroy an object in vbscript?
What is the difference between vb debugger and the script debugger?
Explain about the asc function?
Explain the adodb.stream class?
Explain some uses of vb script?
When are redim statement and preserve keyword used in the vbscript language?
What's the difference between vbscript and vb.net?
What is select case statement?
How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.
What are class properties?
How are arrays declared in the vbscript language?
what is used of Property........End Property loop ? how to write the script for it?
What is the event handling in vbscript?
Mention how to create a cookie using vbscript?