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
where can i learn VB scripint ?
what is the differance between BYVAL,BYREF?
how to operate webobjects in a webpage using getobject function and then using generic methods?
Is VB Script Case sensitive or Case insensitive?
I have attended Anovatek Software QTP interview. They will give us computer and one web based application with QTP. We have to automate some records (already updated records or new records) using QTP Data driven testing. But we should use for loop? Can any one know how to do data driven testing using For loop?
What is sql loader? Explain the files used by sql loader to load file?
Which operator can be used to do an xor operation in vbscript?
write any ttest cases using check points and parameterization
Mention what is byref and byval parameters in vbscript?
How to assign a numeric value to a variable?
What are the valid scopes of a variable in vbscript?
A folder is there inside no of textfiles are avilable. How do count the textfiles. Normally folder means we are using subfolder methods but textfiles is not working for subfolder methods and how do get file name also.
How to make sure that items in a wintree are sorted al?
Can u describe what kind of testing are for OTC derivates by banks.
Which date function is used in the vbscript language to find the difference between the 2 dates?