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
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 |
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 |
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 |
How to use userdifined environment variables.Once we created in Environment tab which is at File--> Settings-- >Environment-->Userdifined
Is it possible to return multiple values from a function..? Then how..?
If there are 10 notepads opened on desktop. how can we close a particular 2nd notepad using script
What is difference in global and action sheet in qtp?
what happen in object repository(shared)if we call an existing action from an external action ? and what happen in object repository(peraction)if we call an existing action from an external action ?
How do we count the no of mails in Yahoo Inbox for a specified week?
How to execute a WinRunner Script in QTP?
Write the regular expression code, it accepts the alpha, numeric and special symbol and the first character should be the Alphabet. Tell me the answer
what are the cases in which we use XML and accessibility check points.
What is operator in VB Script?
What are "Ordinal Identifiers" and where it is used in QTP. AS FAR AS i KNOW, its is used to identify the object. but i want clarity regarding this.
Tell me about qtp?