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
what is inner join? what is outer join? what is a constraint? tell me about rdbms? tell me about acid properties?
How to assign a date value to a variable?
1. How do declare public variable in vb scripts?
How will you get a random number between 0 and 1 in vbscript?
How can you destroy an object in vbscript?
What is the difference between vb debugger and the script debugger?
Which function allows you to instantiate an object given its programmatic identifier or progid?
I have an excel sheet with multiple ID's in a column. Now i need fetch those ID's in an application and check whether if it already exist in the DB. If not then i have to go with the process of inserting them in the DB. If it exists then i need to skip that ID and move to the next ID and check the same and proceed. How can i do that with for loop and if condition?
What are the different types of operators and their order of precedence?
PLz send me the VB scripts which is having more examples my email id : hareen_11@yahoo.com
when we use filter funtiom invb script(QTP)
how to increasing the numbers in a given text box please write a vb script
Which operator is used to perform the comparison among 2 operands in the vbscript language?
hi Set myobj=Description.Create() myobj("type").value="submit" myobj("name").value="google search" myobj("html tag").value="button" browser("title:=google").page("title:=google").webButton (myobj).Click i was running above code in one weak back it was working fine i got result,again i opened after few days ,again i was trying to run the code it shows run time error in last line of my code ,why ?pls answer my question?
What is the output of a + b in vbscript if a = 5 and b = 10?