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



in flight reservation application. when i entered flyto combobox as london. and i have to check th..

Answer / 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

More QTP Interview Questions

what is use of optionexplicit in variable declaration

5 Answers   GE,


in data driven testing for performing operations which method is easy from manual test data,keyword view,or from database.and why?

0 Answers   Wipro,


Waht is User interface and Integration Testing?

1 Answers  


what kind of erros can be handled with the using QTP?

2 Answers   CTS, Satyam,


Explain the types of object repositorys in qtp?

0 Answers  






how to call a funtion in a script? i have saved the login scipt in notepad. with extension .vbs. But when i am calling the function with the keyword CALL <Function Name>. its not working out. can any one give me a clue how to call the external functions. with example.

3 Answers  


How to use Environment parameterization in QTP? Explain with an example.

2 Answers  


When I click on a link in web page.Link should open in new window.can anyone please let me know the script for this ---Koti

0 Answers   HCL,


Hi, How to invoke QTP or any application through Command Prompt without using Vb script and batch file.... Reply me Srinivas

3 Answers   Excel,


What is All object and Local object in Object Repositary? Explain me please.

3 Answers  


what is stepin & stepout?

0 Answers  


In Developer view it is a high priority defect & in tester view it is a low severity defect what is that how to define with an example

2 Answers   Broadridge,


Categories