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



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

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

More QTP Interview Questions

How to convert non-reusable action into reusable action in QTP?(i know by default QTP will take it as a non-reuable action )(Chandana) plz urgent?

4 Answers   Wipro,


Please explain the role of Regular expression in QTP

0 Answers  


What will be happen if i load object repository at run time, but it has already associated.

0 Answers   NTT Data,


we r conduction testing on a project USING QTP, regarding that project the object repository is full ? Till that project having objects that r not recognised by repository, then what wil you do? How we wil recogine remailning objects? Is it possible to maintain another shared(or)peraction repository? what is the maximum capcity of object repository? How the technical people decide this much object repository is enoughf for this project?

7 Answers   AppLabs, CGI,


Hi, While recording a Jave based web application, its recording all my actions and the objects.And I have 5 WebEdit objects on the page and all are recorded. But while execution, at the 2 WebEdit object, its entering the value into the object (Its making a call to the AJAX, matching the value), when the control get out of this object the value is erased or cleared. Could anyone please help. I have recoreded 5 more scenarios where WebEdit is in the picture on different webpages and all are working fine. Here is my Script: Browser("Sign In").Page("Matching Workbench_3").WebEdit ("locationLookup").Set "0320 - SEATTLE-KM" Browser("Sign In").Page("Matching Workbench_3").WebEdit ("supplierNameLookup").Set "TRAMMO PETROLEUM INC" *** SupplierNameLookup is the object, which is haing an issue. And also I was using the SendString function, but it didnt work.

0 Answers  






Is QTP a compiler or interpreter..? can you we execute a QTP Script file in a another system which does not have QTP installed..??

6 Answers   Virtusa,


what is smart identification?

1 Answers  


What is test object?

0 Answers  


what is run-time data?

0 Answers  


In a yahoo web Application there are 65 links.one day it will opens 50 links and another day it will open 55 links.In this scenerio write Descriptive programing for Automation?....Pls write the code for this scenerio.

1 Answers   College School Exams Tests, UHG,


what is the difference between DP and keyword driven framework?

1 Answers  


how to get the particular chr in an array list the question is ....i have an array like this ABCD EBCF GBCH IBCJ HERE I NET TO GET ONLY "BC" FROM ALL HOW TO GET IT HELP ME ANY ONE THANKS

6 Answers   Cap Gemini,


Categories