What is the logic for reading(exporting)the data from flat
files to QTP?Can anyone explain me with an example?

I appreciate it!!!

Thanks!!!
Prasanna

Answer Posted / jhansi rani

the process is
assume the flat file is "abc.txt" which consists of some
data like sno and sname.
first we need to create object for that txt file like

set fso=createobject("scripting.filesystemobject")

next open that file using that fso

set f=fso.opentextfile("path of the txt file",mode)

1 --- readingmode
2 --- writing mode
8 --- append mode

while f.atendofline <> true
f.readline --- to read the line from the text file
.
.
.
.
.
perform require operations
wend


so total script is as follows

Set fso=createobject("scripting.filesystemobject")
Set f=fso.opentextfile("E:\testingexamples\abc.txt",1)
While f.atendofline <> true
msgbox f.readline
wend

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi Friends this is kumar i would like to request to all of you ,please help me to explain real time project with using qtp scripts i know basics of qtp but it won't workout on interviews,pls help awating to reply.

1379


How to use Environment parameterization? Explain with an example.

1485


tell me abt a time when u had to go above &beyind the call of duty to get the job done

1446


What is active screen?

568


we add library file used in test via settings or through "ExecuteFile" command. when we implement framework do we make common library file and load the same for all the test cases execution?

1586






Sql questions to find second max salary and how to use joins

969


Does any one worked on JIL Emulator , Testing with QTP(automation). Trail Version of QTP is not identifying the child objects of JIL emulator, Can any one help me out ,

1384


Can any one tell me how to write a script for selecting open option in File menu of A word document.here you have to add objects to OR.try like that and give me the ans.i asked this question to so many but no one knows.if any one know the answer plz let me know

1409


What is the extension of the qtp local repository? If it is .mtr then what is .bdb extension stands for?

575


How to do the scripting. Are there any inbuilt functions in QTP? What is the difference between them? How to handle script issues?

578


Hi, I am supposed to automate mainframe application through qtp. I do not know how to start abt it. Can you plz help me in first initializing the process or do you anybody have a guide book or a link which guides me through the process of automating the mainframe applications and things involved in it.

6664


1. What is the difference between Keyword and function in the keyword driven framework? 2. How do you associate Keywords to the script ?

991


How you can write contexts to text file in qtp?

597


What is the Difference between copy to action and call to action?

591


How can i initiate the objects to find uniquely in OR

1476