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
Shall we add Local Repository to shared object repository,if yes,how we add
Problem with XML checkpoint in QTP ?
what are the limitations of smart identification in qtp 9.0
What is the use of text output value in quicktest professional (qtp)?
www.icici.com after this home page wll came, in this page what r the items we r going to test for manual and what the element we r test for QTP... explian clearly with example
What is 'sleep' in sync point?
I created 3 actions in test suppose I want to run action 1 in single time, action 2 is 4 time what I do?
how to write the descriptive programming in QTP for remove the object value and substitute, with a variable then call the validation from excel
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.
I want to configure the OR and library files to a particular QTP test during run time. Note: OR and Library files are located in Quality Center. Is it possible in QTP? Anybody having code?
What is optional step in qtp? How you can add optional step in qtp?
Hi any body pls help me for QTP 11.0 software free demo version. i have to practice. Kindly send the link.or where i have to download.
What is the basic concept of quicktest professional?
In QTP TEST DIRECTOR COMBINATION WHAT IS THE PURPOSE OF TEST DIRECTOR? In Somebody says to store test cases and design test cases.?ok fine , but In test director 5.0 , QTp not launching. what u do?
How does you test a weblink which is changing dynamically?