Hi
I have a doubt in qtp. Can you please clarify my doubt.
If we are importing the data from excel sheet in qtp the
the script is running the number of row times.
I mean if there are 4 rows in excel sheet the script is
running 4 times. cant we avoid this.
suppose i have tis script:
datatable.Import "C:\Documents and Settings\sailaja\My
Documents\login1.xls"
n = datatable.GetRowCount
For i =1 to n
systemutil.Run "C:\Program Files\Mercury
Interactive\QuickTest
Professional\samples\flight\app\flight4a.exe"
datatable.SetCurrentRow i
Dialog("Login").WinEdit("Agent Name:").Set DataTable
("Username", dtGlobalSheet)
Dialog("Login").WinEdit("Password:").Set DataTable
("Password", dtGlobalSheet)
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").ActiveX
("MaskEdBox").Type "020209"
Window("Flight Reservation").WinComboBox("Fly
From:").Select "Frankfurt"
Window("Flight Reservation").WinComboBox("Fly
To:").Select "Los Angeles"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights
Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "Sailaja"
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").WinMenu
("Menu").Select "File;New Order"
window("Flight Reservation").Close
next
I created a excel sheet with 3 rows and 2 columns.
(username and password). The script is running 9 times. I
made the option run one itaration only . eventhough it is
running 9 times .can u plaese clarify my doubt.
Thankyou
Sailaja.
Answer Posted / sreekanth chilam
Hi Sailaja,
As by defalut in Test menu-->Settings-->Run Tab
Options will be -- Run on all rows
Hence if datatable contains 'n' number of rows, script will
execute that much number of times.
To avoid the above situation:
1.Go to Test menu-->Settings-->Run Tab
2.select "Run only one iteration" option button
3.Click Apply -> OK
4.In script give the below code
datatable.import "excel file path"
rowcount=datatable.getrowcount
for i=1 to rowcount
datatable.setcurrentrow(i)
-------
-----
Next
Now see ur prolem will be solved.
Cheers,
Sreekanth
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
iam have done mba(finance)in 2008. in 2008 one reputed consultancy came off campus interview our institution. i got job as "manual test engineer". now iam working as "manual testing engineer". now my problem is when iam going interview the interviewer asking like " ur mba gradute how can u get job in test engineer." this question i have faced every interview. iam explaining how iam getting job. but they are not trust me". pls tell me answer how i am giving relavent ans.. this is my mail id y.ramana84@gmail.com
Where is the Bitmap checkpoint information stored?
How are actions and functions different in QTP?
How you know that a test case is a regression test case
If you are testing a web application then what will you test in that application?
When to use descriptive programming?
How do I lauch my test website using code from qtp in different environmet, uat and PPTE?
How to start recording using quicktest professional?
Is it possible to call from one action to another action in qtp?
What is accessibility check point?
what type of run time errors you get while you ar edoing rpg program?
How do you do batch testing in wr and is it possible to do in qtp, if so explain?
What is the use of an object spy tool in qtp?
What is test object?
What is parameter in qtp?