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
i'm testing the webpage with QTP, in this wabpage i have to choose the CV from the window, but QTP can't recognize the object, so i used the Low LEvel Recording, but every time i run the test, QTP go to halt when it gets to the Recorded part, any solution for that?( except puting delay in the script and manuall selecting, because i've did that)
what is description object?
how do u plan test automation?
Can any one tell me about "Mapping Repository Parameter Values" and why we use it....??How to use it???Please, tell the preconditions also...........???? Thanks in Advance
Can anyone tell me how i used QTP 9.2 use for GIS based S/w with an example?
How do you send email with attachment from outlook using qtp ?
Hi friends did any budy attend accenture system test for qtp? if any budy pls drop questions.not only accenture any other mnc company which you attended system test(QTP)?it may helpful to others also
any body plz send health care domain project to me with explanation any two modules on that project. mail_id: ranjith_99reddy@yahoo.co.in
how many maximum number of virtual users we can create?
I am having major problems with some DB Table Checkpoints I add to my script. I 35 web based applications recorded and each has DB Table Checkpoints insert but only 1 script isn't recognizing the DB Table Checkpoints for some reason. I've checked the DB connections and the info in the Library Functions and still only this one script out of 35 doesn't recognize the DB Table Checkpoints. Can someone please help me figure out why only this one script out of 35 that's hitting the same database is having a problem.
Explain hybrid framework with advantages and disadvantages?
Define virtual object?
What does mean by Scope of Automation?n How we defined it?
Can you brief the hurdles you faced during Automation testing?
What is data driver in qtp?