How can we parameterize our test, values in flat file.
Ex:- Values in notepad, with that values i want to
parameterize the test.
Answer Posted / 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 View All Answers
what is the diff between manual test plan document and automation test plan doc.can u explain indetail.
hi in real time who will execute the qtp test scripts? my faculty said, in a companty automation testers are written the test scripts and manual testers are execute the test scripts...IS IT RIGHT OR NOT?
What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?
What is checkpoint in qtp?
How to creating an output value using quicktest professional (qtp)?
How to use transactions in qtp?
How can you give wait up to 10 seconds in qtp?
Explain types of descriptive programming?
what is profile tool?
For example you are checking bit map check point before coming to the results. How can you say it is passed? Or failed? Anyways?
how can i call function (which has link with excell sheet at a remote location) within another function
I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format, if possible, kinldy mail PDF file to my mail-ID: ramakrishna908@gmail.com Regards, krishna.
Explain Descriptive Programming Types with Examples?
What do you mean by iteration?
QTP script is not working on other's machine..