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 All, I Want To excute scripts batch without using QC .I need code for that Thanks Balaji

1503


Is it possible to use two instances of UFT on the same machine? If not why?

768


what is the advantages and disadvantages of using functions instead of re usable actions

1584


Hi I am new to QTP. can u please answer to my qus... suppose 3 excel sheets are there * we are trying to check for login credentials for a page. userid from excel1 , password is from excel2 whether the page is opened or not that checkpoint is result is should be stored in excel 3.... this qus i have faced in IBM technical round... please tell script for above query ... please please

1669


Is it possible to change the values of analog recording?

752






Explain the keyword driven framework for the window based application complete creation of library files,env file,test data,recovery file,excel file ,repository etc and as a test engineer how is ur approach

1762


assume i have few url link how will i dynamically call then using descriptive programming?

1742


what is stepin & stepout?

1560


Give me detailed theritical explanation about keyword driven, hybrid framework, environment variables, hybrid frame work

1619


Explain how to use QTP to check broken links on a page?

723


What are the different types of recovery operation?

678


What does it mean when a check point is in red color? What do you do?

724


how to convert 100 into hundred repees only and viceversa

1627


Can any body please tell me the steps of keyword driven framework of QTP.

1710


Please guide me release notes of Automation once scripts are completed

1592