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

write a vb script to find simple interest using functions

1 Answers  


write a program to display configuration of a local system with the help of vb script.

0 Answers  


How to replace junk code recorded by QTP with a mall function.

0 Answers  


A folder is there inside no of textfiles are avilable. How do count the textfiles. Normally folder means we are using subfolder methods but textfiles is not working for subfolder methods and how do get file name also.

0 Answers  


Can anyone help me in write coding to get this pattern * ** *** ****

3 Answers  


What is the purpose of drive object of scripting.filesystemobject class in vbscript?

0 Answers  


Mention how to assign a date value to a variable?

0 Answers  


Which conditional statement is the most convenient one to use in the case of multiple conditions in the vbscript language?

0 Answers  


Input = 124 output should be 124421 Please do not use any string functions/variables

8 Answers   Cap Gemini,


Join the multiple array with out using JOIN function

1 Answers  


i need to sort the data using qtp script for this how i need to write a qtp script

0 Answers  


How to create a function in vbscript?

0 Answers  


Categories