03-15-2008, 11:19 AM
Hi I tried the same thing for mercury tours windows application. here it takes all thedata from excel sheet. but my problem is for i=1 the script is runnig for 3 times (coz there are 3 rows in excel sheet)for i=2 its running 3 times.how to aviod this.thanks in advance.[/u]
Code:
Datatable.Import ( "C:\Documents and Settings\sailaja\My Documents\usename.xls")
num=datatable.GetRowCount
For i=1 to num
systemutil.Run "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
datatable.SetCurrentRow i
Dialog("Login").WinEdit("Agent Name:").Set DataTable("Agentname", 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
'o=createobject("scripting.filesystemobject")
'Set outputfile=fso.createtextfile("C:\Documents and Settings\sailaja\My Documents\output.xls",true)
' outputfile.writeline("step passed")