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
Hello friends..... Can any give the methods for Ms-Access, and Mozilla firefox in Automation Object Model in QTP. Please give me currect answers... if you do not understand my question please don't give answers. Thanking you.
Which operator can be used to do an xor operation in vbscript?
Explain the .wsf files?
How to access array data?
How strcomp function works?
How can the spaces from the string be removed?
What are the data types supported by vbscript?
Which date function is used in the vbscript language to find the difference between the 2 dates?
How to use QTP Object in .vbs(vbscript file) file Ex: Browser().., wait(), exist() and etc...
who will create the object?
If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?
When does ‘on click of button’ event gets triggered in the vbscript language?
Hai this is sheik, i want to learn VB scripts for web application pls guide me what are all basic things need to know to learn VB scripts in web application.
Write a Program to add 2 numbers without using operators (+,-) and without using third variable. Note: Use VBScript only Hint: You can use other operators like '/' & '*'(Division & Multiplication)
What are the different types of loops available in the vbscript language?