in flight reservation application. when i entered flyto
combobox as london. and i have to check this london is
present in flyfrom combobox.give me the code with good
explanation.
extention to this question.
at each iteration i have to put(WRITE) the fly from
and fly to city in database table
Answer Posted / baba
invokeapplication "C:\Program Files\Mercury
Interactive\QuickTest
Professional\samples\flight\app\flight4a.exe"
dialog("Login").WinEdit("Agent Name:").Set "baba"
Dialog("Login").WinEdit("Password:").SetSecure
"489ff6345f83ebb85f1f91f6e86ee1c1f7a8307c"
dialog("Login").WinButton("OK").Click
msgbox now
window("Flight Reservation").WinEdit("Date of Flight:").Set
"09/09/09"
'''''''''''''''''''''''''''' Fly From
'''''''''''''''''''''''''''
expval="London"
i=window("Flight Reservation").WinComboBox("Fly
From:").GetItemsCount
msgbox i
y=window("Flight Reservation").WinComboBox("Fly
From:").GetContent
msgbox y
For j=0 to i-1
x=window("Flight Reservation").WinComboBox("Fly
From:").GetItem(j)
datatable.SetCurrentRow(j+1)
print x
datatable("Fly_From",1)=window("Flight
Reservation").WinComboBox("Fly From:").GetItem(j)
If (expval=x) Then
window("Flight Reservation").WinComboBox("Fly
From:").Select(j)
End If
Next
''''''''''''''''''''''''''''''' Fly To
''''''''''''''''''''''''''''''
expval1="London"
k=window("Flight Reservation").WinComboBox("Fly
To:").GetItemsCount
msgbox k
l=window("Flight Reservation").WinComboBox("Fly To:").GetContent
msgbox l
For m=0 to k-1
datatable.SetCurrentRow(m+1)
n=window("Flight Reservation").WinComboBox("Fly
To:").GetItem(m)
print n
datatable("Fly_To",1)=Window("Flight
Reservation").WinComboBox("Fly To:").GetItem(m)
If (exp1=n) Then
window("Flight Reservation").WinComboBox("Fly To:").Select(m)
else
reporter.ReportEvent micPass, "Validation is
correct","London is not matching in Fly To: field"
End If
Next
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Hi all, I am using windows vista, I am in the process of learning QTP. When ever I try to work with insert mode in flight application , i am getting the error of 'Operation must use an update table query, fractional truncation(null) error. Can anyone help me regarding this?
How to check which add-ins are associated with a test in qtp?
Why to use descriptive programming?
what is the difference between built-i function and In-built function?
hi i am working with vbwindow on qtp.first i am openning qtp whenever open qtp my application not open that time generated error like "Runtime error 0" and fatal error:automation error how to solve this problem pls tell me
How to modify object property in qtp ?
What is the diff between image and bitmap check point?
Explain xml checkpoints.
Hello Everyone, Please provide me the practical example of business component concept of QTP.Like how to create business component,how to connect the quality center etc.... Thanks in advance, Gaytri
To which environments does quicktest professional (qtp) supports?
How can you give wait up to 10 seconds in qtp?
What is checkpoints for quicktest professional (qtp)?
how to find that tools work well with ur existing system?
How we can import data from database?
Whats the realtime QTP testing process