Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 Help Members By Posting Answers For Below Questions

can anyone tell me the procedure of interview held in applabs

2182


write a function to read the items from combobox of Flight reservation & save in excel (QTP)??

2843


Which operator is used to concatenate the 2 values in the vbscript language?

1002


What are the rules to name variable in vbscript?

1069


Why is the use of exit do or exit for statements within loops discouraged?

1039


Write a Script for ATM in QTP

3881


Explain few date functions in vbscript?

1045


What are subprocedures in vbscript?

1098


What are class properties?

1162


Explain about scrrun.dll?

950


How to write a VBscript for web page performance test i need a code send if any knows the code If any knows VBScript book plz send to me the link to my mail plz

2861


Write a test case using Test if the images,a particular test exists,check if the page links match,page response is within a certain range,parameterization of the test,the test should comprise of actions,the test should use a custom function,the test should use global repository

2229


Which function allows you to instantiate an object given its programmatic identifier or progid?

1024


What is the difference between do until loop and do while loop?

1048


What is the difference between vbscript and vba?

1121