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?



How to use Text file (Notepad) as ur data source in QTP? Can u please provide some function code fo..

Answer / 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

More VB Script Interview Questions

I need to get some data from data base and store this (retrieved) data in a excel sheet using VB script in QTP9.0 I have created connection for data base I have created as excels sheet by using Set XL=CreateObject("Excel.Application") XLworksheet.cells(1,1).value= rs.fields.item("<<The data retrieved from data base >>") I have taken a for loop and changed the cells values (1 as i and another 1 as j) But still I am not able to get Plz kindly tell me know this . It is very urgent

0 Answers  


Write a program to resize an array of 5 elements to 4 elements and display all the elements.

1 Answers  


sunday is sunday monday tuesday wendesday sunday thursday friday saturday sunday sunday how to count no of sunday in the text file from vb? Answer me asap

4 Answers  


How to get path of the file through scripting?

1 Answers   Hexaware,


what do you mean .ota mobile format

0 Answers  


How to throw an error in vbscript?

0 Answers  


can anyone tell me the procedure of interview held in applabs

0 Answers  


w r p syed then output was deys and click eysd and click ysde and click sdey and click deys and click eysd............

2 Answers   Cap Gemini, iGate,


What are class variables?

0 Answers  


Compare java script and vb script?

0 Answers  


what is the standards used for writing the script in QTP

0 Answers  


Explain about scrrun.dll?

0 Answers  


Categories