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

Hi all..I have two values. a=20 ,b=30 I want to perform c= a+b and c= a*b using user define function.please anyone give the answer

1 Answers  


How to get 120 using 5 zeroes, you can use any operator(+, *, /...) in qtp.

2 Answers   Cognizant,


Suppose by navigation I went from 1 st page to 5 page ,so Write a generic script for coming from any page to the 1st page and by executing where the page may be it will come to 1st page

1 Answers   CybAge,


What is the equivalent of VBScript?s On Error In Jscript ?

1 Answers   Microsoft,


How will you trim the spaces on the left of a string using vbscript?

1 Answers  


Can any one provide code for Mid(string,start[,length]). I have been asked to write code for Mid(). i.e We need to define our own function say MyMid() which should behave same like built-in Mid function

0 Answers   Microsoft,


In what way program "hello world" you can write in vbscript?

0 Answers  


Mention what are the rules to name variable in vbscript?

0 Answers  


how to write function to validate the number of characters entering into the text box?

2 Answers   TCS,


Like OPTION EXPLICIT statement what are the other statements used in vbscript and their usage. Please post me all the statements please.

0 Answers   Accenture,


what types of bugs will we find out in banking projects for automation testing?

0 Answers   Napier Healthcare, TCS,


How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.

0 Answers  


Categories