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


Please Help Members By Posting Answers For Below Questions

What does it mean when a check point is in red color? What do you do?

572


What is the basic concept of quicktest professional (qtp)?

588


how to do the batch testing in test director using manual testing procedure?

1783


Explain the types of object repository?

562


can u explain the keyword driven framework with an example clearly how to create all the files and how to attach to main test.

5112






Describe how Smart Identification is used

1702


What is 'sleep' in sync point?

633


What is text check point and text area check point?

620


Explain advantages and disadvantages kdf?

535


Diff b/w test scenario's and test Procedures?

1641


what is the diffrence bw qtp architectute and qtp framework?

1548


after initiating one project for testing, when exacltly QTP tester role starts?

1414


Does QTP have any limitations?Can it work with all kinds of programming languages like java,springs,ajax ,hybernet?Also does it work well with windows 7.What are its other limitations

1779


How to test the login page in different ways in automation testing and i need code?

1356


Hi guys, Our company has started to automate testing and started using the tool QTP.Iam new to QTP and I have the following questions to ask. Would appreciate if anyone could give me a hand on this and explain things in a detailed way. [1] Bugs outside checkpoints: I know that I can easily make the QTP do what I want inside the application. Also, I know that I can insert some checkpoints and that the qtp will notice if those conditions are not met. However, there are bugs and problems that might not be connected to a checkpoint (system crash, database error, losing session/logout etc.); how can I make sure that the QTP will notice such problems as well and flag a test as failed. [2] How to tell the QTP that when a particular statement is "false",it should flag it as, test failed and show in in the test report. In short how to tell the qtp that a test is false from the script so that it shows it in the report For Eg:- if(true) test passed // how to instruct qtp else test failed // how to instruct qtp [3] Test script portability: we are having several environments; If I record a test on User Interface, obviously, the qtp will save the URL; however, how can I make the qtp run the tests so that the url is provided dynamically. Is there a possibility to parameterize the web server.Is this the way to do it.I dont know? [4] Test management: How do I manage the tests? I guess we will be doing it in Quality Center, yet, it’s not perfectly clear to me how we will be doing that. [5] Running scheduled test sets: How do I group tests to a certain test set? How can I make this test set run at a predefined time? [6] Test maintenance: What do we need to do beforehand in order to enable for easy test maintenance, meaning small adjustments in tests? [7] Reports: What kind of reports on test results are available (either QTP or Quality Center)? Thanks in advance and hoping for an answer. Jen

1482