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
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 |
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 |
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 |
Can we put more than one action in a single script???? yes or no.....
Does quicktest professional (qtp) is unicode compatible?
What are the properties you would use for identifying a browser & page when using descriptive programming ?
Hi all. Could anyone tell me the difference between an Action and a Function in QTP. Thanks in advance and Merry Christmas.
What is post recovery scenario?
How do you do batch testing in QTP, if so explain?
What is the default object synchronization timeout in qtp?
Think and Reply.. can we parameterize radio buttons, check boxes? as in flight web site on flight preference page, choosing different flight produces trouble if from port and to port been parameterize, and runs. Try it by own you will get the error.
How to add object to object repository in qtp9.0 Suppose for brower yahoo home page
how to idetfy which test cases are automated?who will deside that plz tell me
c language is thre but what is the purpose of c++, java is there but what is the purpose of Advanced java ....why these are all versions are coming...whta is the problem?
how to find that tools work well with ur existing system?