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
Hi All , How can we decicde for pariticular frame(DataDriven or Keword Driven)in Project? Thanks Balaji
What is the significance of “action 0” in qtp?
supose i hv to acsess some functionlaties of a test in 1 machin , some part other machin how can acsess?
Can you brief the hurdles you faced during Automation testing?
your coming from electrical backgroung..but y ur coming to software side?
when to start the automation?
How will you find the current time of the remote machine using QTP script?
Both static and dynamic arrays are handled by the vb script. Is it true?
Hybrid framework supports Descriptive programming. Is it true?
How do you do batch testing in wr & is it possible to do in qtp, if so explain?
In qtp, how you can exit for loop?
In qtp, explain what is crypt object
What are the advantages of Object Repository?
what are the limitations of smart identification in qtp 9.0
Hi Friends, How many types of Data Bases available in market... What is the diff. while using Syabase and Oracle in a Project... ? and what is the main diff. of Syabase and Oracle databases... ? Thanx in advance..