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 |
I am using Shared OR, and my collegues are also using Shared OR. How to merge Object Repositories?
I have 14 itmes in a drop down that are associated with an account And these items change with different accounts I want to be able to define it by and index number or any other id so if I enter 2 in my Global excel sheet it selects the 2nd item from the drop down - is this possible?
CAN WE USE 'BVA' AND 'ECP' IN AUTOMATION?
If you have two monitors one is of 19inch and the 2nd one is of 24inch,if you want to write same QTP script in both the two monitors is there any changes required in the script?
I opened gmail login into gmail and i have to save (Pass or move) all the mail into notepad please give me code Thanks of all
What is the Limitations of Testing ?
hi is there any chance to change encoding the password
In an Excel sheet take two fields as agentname and password and type some valid agentname and password.call that excel sheet in qtp so that qtp opens the flightreservation window taking into consideration how many records are entered in the excel sheet.For example if 3 records are entered today it will open 3 FR windows,if in near future the records are more than 3 then it will open that number of times.
There are some links on the page,count and click those links and check the text on the page displayed on clicking the link.write script for this scenario.
did you perform retesting(DATA DRIVEN test) using functions with out using datatable methods how can you perform retesting using functions
how can i call an external action,which is not added external action of an action?
How do you create a library file