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

Does QTP supports Linux or Unix OS?.If so which scripting is preferable? Shell we do record and playback

1 Answers  


In a webtable,a list of values are there,rightnow one values shows,later random another values shows,but how to retrieve the random value in webtable.

1 Answers   HP,


When Recovery scenario actually starts while testing the application?

0 Answers   SAP Labs,


what is the Debug view?

1 Answers  


Hi any body can tell me the in detaled information about Description.Create() thanks in advance

2 Answers  






Using QTP checkpoint, where do you store your expected Properties of the object which later compares with the actual properties of the object???

4 Answers  


A web table is having 3 columns(name, salary and checkbox) in qtp How to select a checkbox based on the highest salary of an employee in a webtable.

1 Answers  


give me the code for check point for validating application

1 Answers  


How to enable the text check point in qtp? By default it is disables

1 Answers   Sify, ssinformatics,


How to handle recovery scenario for a application crash.write script for this.

2 Answers   Polaris, TCS,


how many scripts r there in QTP? pls any answer this question?

4 Answers  


why qtp supports vbscript? and not for others just like cgi,phython,shell,perl,html and all..

4 Answers   Cap Gemini,


Categories