10-30-2010, 09:53 AM
I am trying with following scripts, but still not get expected result.
Code:
dim i,f,x
SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set "derfs"
Dialog("Login").WinEdit("Password:").SetSecure "4cc3c6e3f379b4bebf919e0c56d8d4ad4172027c"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").ActiveX("MaskEdBox").Type "111910"
f=Window("Flight Reservation").WinComboBox("Fly From:").GetItemsCount
datatable.AddSheet("output").AddParameter "from", ""
datatable.AddSheet("output").AddParameter"to",""
For i=0 to f-1 step 1
x=Window("Flight Reservation").WinComboBox("Fly From:").GetItem(i)
DataTable.Value("from","output") = x
t=Window("Flight Reservation").WinComboBox("Fly To:").GetItemsCount
For j=0 to t-1 step 1
t=Window("Flight Reservation").WinComboBox("Fly To:").GetItem(j)
DataTable.Value("to","output") = t
DataTable.SetCurrentRow(j+1)
If x <>t Then
Reporter.ReportEvent 0,"Res","Test Passed"
Else
Reporter.ReportEvent 1,"Res","Test Failed"
End If
Next
next
DataTable.ExportSheet "G:\QTP Result\Exported files\Get values form both drop down.xls","output"