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
explain abt dyanamic changing object with example?
Please provide specific examples of advanced/creative usage of QTP, including how impact & benefits for your project
hi Friends ,willany body tell me what is the Scope for the automation Testing inht Future is their Or not And what is the Top Most Level in the testing section according the Pay scale
tell me QTP standards ?plz
How the exception handling can be done using quicktest professional (qtp)?
I have some real time based question.. 1.what are the challenges you have faced in your current project. 2.what are the bugs you found in your current project. 3.what are the strategies you follow to convert manual test cases into automation test cases. 4.how QTP identify two different browsers. 5. When you create a function library and share object repository what are the problems you have faced 6. How to solve the tool tip problem 7.what are the interesting bug you have found in your current project. 8.what is your daily work as a automation test engg. 9. how to create a weekly status report. 10. how many test cases you write,review and execute per day. 11.what are the uses of SQL in automation. 12.How to retrieve the data in html through vb script. 13.If application is very slow how to test the application in qtp.
How will you compare keyword and expert view?
What is the syntax to call one action in another?
What is a quick test professional?
we add library file used in test via settings or through "ExecuteFile" command. when we implement framework do we make common library file and load the same for all the test cases execution?
any body can you help me what is the script to automate an comand promt
What is standalone database?
How to automate a script in mainframes environment? I have the terminal emulator Add in. Describe in detail.
What kinds of security (firewalls, encryptions, passwords, etc.) will be required and what is it expected to do? How can it be tested?
What are the different recording modes?