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 |
Hi, I want to write the script for a webpage. But i didn't added the properties of the objects to the object repository. Without adding the object properties to the object repository, how to write the script. When i am writing the script, Let us say i typed as Browser (""). after selecting ".", if the object is added to the object repository it will display atomatically. But in my case it is not as i didn't added the object properties. How to proceed further in the above mentioned case to write the script manually. Pls let me know if you didn't understand the question.
What is regular expression?
I need to know how to Automate a Username and Password for a Web-based product? I'm scripting 3 different types of surveys but each Survey requires a Username and Password which is always the same. I can I do this using QTP?
With what extension you can save the list of tests in a file to run in test batch runner?
Diff b/n image n bitmap checkpoints?
WHAT IS OBJECT REPROSITORY?
how can i do QTP Certification can any 1 tell me . How 1 approch and who to approch
How to find the difference between 2 dates in qtp?
Which property do you use to retrieve or assign data into a cell in a Data Table object?
What is the maximum size of Object Repository in QTP 8.2?
take one example and write vbscript on one web application in qtp? explian descriptive programe with one example?
How to capture the text from the application using QTP?