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
Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.
How will you get the largest subscript of an array in vbscript?
If a calulator having 3 buttons (of any number)in 3 of them one is not working properly due to which answer is wrong always. write a script to find out which button is not working properly ?
Explain what is loose binding? Why is it not a good practice to use it?
Write program for identifyig duplicates in flight Departing from and Arriving in mercury tours(web application).
give me any information abou vb script books learn quckly
Plzzzzzzz can any one tell me which is the best institute in hyderabad for learing VBScript. plz do answer guys its urgent plzzzzzzz. thanks in advance.
How to find the font in qtp. Scenario:After entering the username and passwd you will be navigate into the "welcome:Username" page.Now I want to extarct font for this message.
Explain about adodb.stream class?
How will you convert a given number to long in vbscript?
How to capture a runtime error in vbscript?
What is vbscript language used for and which earlier language is it modeled upon?
Explain the operator precedence in vb script?
How to create a function in vbscript?
What are the 2 ways in which a variable can be declared in the vbscript language?