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.

Answers were Sorted based on User's Feedback



Hi I have a doubt in qtp. Can you please clarify my doubt. If we are importing the data from ex..

Answer / sailaja

Hi Srikanth
Thankyou soo much. Now my script is running fine . Before I
did the same setting in keyword view->Action right click
Action call properties Run on all rows.But it did not
solved my problem . Once again thankyou soo much.

Regards
Sailaja.

Is This Answer Correct ?    1 Yes 0 No

Hi I have a doubt in qtp. Can you please clarify my doubt. If we are importing the data from ex..

Answer / 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

Hi I have a doubt in qtp. Can you please clarify my doubt. If we are importing the data from ex..

Answer / infanto

i have a question
Wen ever i use IE=createObject
(Ineternetexplorer.application)
QTP just navigates to the URL mentioned but doesn't
recognise the USErname and Password field so the test
fails..
But wen i just record and use system.util "iexplore"
the code recognises and the tst passes, but here it works
fine sometimes and sometimes the test just fails and
aftersometime i run it works.. so its not consistent,,, any
suggestion

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

how to read log file using QTP??

3 Answers   AppLabs,


what is Smart identification

1 Answers   Wipro,


What are the disadvantages of Recovery Scenarios in QTP ?

3 Answers  


write a script to close all open browser in qtp except one browser whose name is xyz

6 Answers   Cap Gemini,


Hi everybody.. I m using QTP 9.2 version., plz send me licence key is it seat or concurrent licence key... plzzzzzzzzz plz help me for this one and its Locking code:8-5C740 Maintenance number: 0123-2820602186.,

1 Answers  






What is accessibility check point?

0 Answers  


. My application is updating the user information in the application. Every time it is Adding on record in my application and Validating the information like “Record has added successfully”. Which Check point I have to put in this situation? Why?

5 Answers   Polaris,


Anybody can tell me what are the common roles and responsibilites of a Automation Test engineer

2 Answers   IBM,


how i can get the value of label box , please any body tell me script of that code

1 Answers  


hi,which is the best book to refer QTP 9.2 and Faq's.

2 Answers  


Whenever we r keeping mouse pointer under the image we r getting image name. In qtp how can we do this thing.weather that name is coming or not?

5 Answers  


what is the difference between xmlutil and xmlDOM in qtp?

2 Answers  


Categories