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 |
By using QTP can we record any log files written by the application which is in execution?
How QTP integrate with application?
How to enable the text check point in qtp? By default it is disables
1 Answers Sify, ssinformatics,
Is it possible to call win runner script in qtp?
How many function you use in your application?
How is GC reddy online program Will i get placed How are the placements.
How many actions we can create with in a test?
Which environments are supported by hp qtp?
How cookies can be tested in QTP?
i don't have any experience in qtp? Can u please tell me What work i have to do?
What is the framework your company is following. What is the reason. Explain why key word driven frame work is chosen.
I'm quite new at QTP. Im doing a web-based app testing. I create something new item and a new link is created in the home page. This link is dynamic as it changes every 3 seconds. Obviously the new link is not in my Object Repo and I am trying to find a way how can I do a check or get the propery of the link I created. I can do it on keyword, but I need to do a check on expert mode, vbscript. I always get an error that is not identified whenever i try to check it (browser(b),page(p).link(newlink). Any idea?