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



How can we parameterize our test, values in flat file. Ex:- Values in notepad, with that values i w..

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

How can we parameterize our test, values in flat file. Ex:- Values in notepad, with that values i w..

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

How can we parameterize our test, values in flat file. Ex:- Values in notepad, with that values i w..

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

Post New Answer

More QTP Interview Questions

What is the difference between run time object and test object in QTP?

0 Answers  


In Manual testing , can u prpare bug report in TD?

1 Answers   TCS,


How can you write the scripts that operate on different objects depending on run-time information?

0 Answers  


What is the difference between two actions?

1 Answers   Wipro,


Plz explain about object propeties in object identification? means.. explain about 1. mandatory properties.2. assestive properties 3. ordinal properties.

3 Answers   TCS,


What is the main difference between desriptive programming and generic functions

2 Answers   HCL,


how can we return a value from userdefined function for eg 2 functions in func1 iam getting 2 values(a,b) and storing in var(C). now i want to pass that var(c) to another func2 give me the script

1 Answers  


What do you do if QTP doesn't recognize object ,what action should be taken

11 Answers   Lehman Brothers,


What are the main features we have to compulsory test by using qtp in an web based application

1 Answers  


Hi..friends can anybody write the script for this question... Am having some 20 nos of links in a web application, i want to click some 5,13 & 17th links. So please....can anybody give the answer....??? -->Hani<--

4 Answers  


list me out the shortcutkeys for some functionlities in the qtp for example to record ,to run ... etc

2 Answers   CTS,


How can I replace all the text from the QTP script with some other text.

1 Answers   Livetek,


Categories