How can we parameterize our test, values in flat file.
Ex:- Values in notepad, with that values i want to
parameterize the test.

Answers were Sorted based on User's Feedback



How can we parameterize our test, values in flat file. Ex:- Values in notepad, with that values i w..

Answer / ratankumar

Hi Dear friends!
As per my knowledge iam giving the script to do datadriven
by flatfile in qtp.
First creat a notepad with some inputs in d system
thenOption explicit
Dim fso,f,x
set fso=createobject ("scripting.filesystemobject")
set f=fso.opentextfile("Path of the notepad")
While f.atendofline <>true
x=f.readline

Window("Flight Reservation").WinMenu("Menu").Select
"File;Open Order..."
Window("Flight Reservation").Dialog("Open
Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open
Order").WinEdit("Edit").Set x
Window("Flight Reservation").Dialog("Open
Order").WinButton("OK").Click
Window("Flight Reservation").WinButton("Delete Order").Check
CheckPoint("Delete Order")
Wend

Is This Answer Correct ?    2 Yes 0 No

How can we parameterize our test, values in flat file. Ex:- Values in notepad, with that values i w..

Answer / srinivas prasad

dear friends for qtp documents visit www dot gcreddy dot
com, there you can find more information abot
parameterization

Is This Answer Correct ?    1 Yes 0 No

How can we parameterize our test, values in flat file. Ex:- Values in notepad, with that values i w..

Answer / arunsingh

'Open a notepad and enter some values in
'line by line and save it (C:/a.txt)
'FlightReservation window should be opened

set obj=createobject("scripting.filesystemObject")
set file=obj.opentextfile("C:/a.txt")
i=1
While file.atendofline<>true
n=file.readline
datatable.setcurrentrow(i)
datatable(1,1)=n
i=i+1

'Record some transactions by opening a ordermenu and
'enter order number

Window("Flight Reservation").WinMenu
("Menu").Select "File;Open Order..."
Window("Flight Reservation").Dialog("Open
Order").WinCheckBox("Order No.").Set "ON"

'replace order number which u entered
'at the recording with n

Window("Flight Reservation").Dialog("Open Order").WinEdit
("Edit").Set n
Window("Flight Reservation").Dialog("Open Order").WinButton
("OK").Click
if(Window("Flight Reservation").Dialog("Open Order").Dialog
("Flight Reservations").exist)then
Reporter.ReportEvent
micFail, "OrderNo "&n, "Not Exist"
Window("Flight Reservation").Dialog("Open
Order").Dialog("Flight Reservations").WinButton("OK").Click
Window("Flight Reservation").Dialog("Open Order").WinButton
("Cancel").Click
datatable(2,1)="not Exist"
else
Reporter.ReportEvent
micPass, "OrderNo "&n, "Exist"
datatable(2,1)="Exist"
end if
Wend


Try for this u will get it.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

How many tabs are available in debug viewer pane?

0 Answers  


What is the file extension of the code file and object repository file in QTP?

0 Answers  


what are the different data driven types?

6 Answers  


IF there are seven browsers with same name open. I want to close one particular browser thru QTP. how can i do this?

3 Answers   Polaris,


Hi, i am rani ,i am putting 1+years of fake exp ,so pls anyone explain how i get project (in real time) ? how it is tested ex: in banking ,test the number of textboxes in one window

3 Answers  






How to handle "Java Runtime error" popup window in the web application ? Sometimes the application throws the error repeatedly... Is there any browser setting available to disable the error ?

2 Answers   TCS,


How to capture the Check point Value into a variable?

2 Answers  


datatable.Import("E:\Programming Samples\QTP Samples\OrderNumbers.xls") Asume we have 4 records in datatable Code reads the 4 rows in the sheet ok, but does it 5 times? It doesn't sound like closing the datasheet is the problem Can we close the datasheet runtime ?

2 Answers  


Dear All, How to generate Pass or Fail Report in QTP without using Reporter.Report Event Method ? Thanks Balaji

0 Answers   TCS,


What is the difference between gettoproperty and settoproperty?Explain with an example?

4 Answers   QQS, Satyam,


how will you check how many members visited the website www.infosys.com?

0 Answers   Logica CMG,


How we can we create a Text checkpoint in QTP 9.1,Actually what i did is first i put in recording mode and gofor Inser menu>Checkpoint>Textcheckpoint>click,Now an hand symbol came and i showed it to some textbox and cliked but the QTP9.1 is giving an error message like "The Obkect you are selecting doesn't support this operation" If i go for Help of QTP 9.1 information I didn't get any solution,pls help me in this issue.

6 Answers  


Categories