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 to Import data from a file (file is on the desktop) to the data table
Does VB/Win make standalone .EXE files?
What is the use of the formatdatetime function in the vbscript language?
What are the advantages of vbscript?
When does ‘on click of button’ event gets triggered in the vbscript language?
What are the differences between sub procedures and function procedures?
What is loose binding? Why is it not a good practice to use it?
What are the different types of loops available in the vbscript language?
how to check whether link is disabled in QTP??
What if you do not specify anything when you call a procedure?
Which function is used to perform string comparison?
Is VB Script Case sensitive or Case insensitive?
How to take whole text output from screen of Bitmap Application.
Mention what are the rules to name variable in vbscript?
Which date function is used in the vbscript language to find the difference between the 2 dates?