GetRoProperty, What is GetRoProperty
What is GetRoProperty ?
GetRoProperty is a standard method available in QTP, Its
generally used to fetch the value of property for a run time
object.
GetROProperty – Will return back the current value mean it is
run time value of the testing object property in the application from
the object.
It also retrieves the present value of property of object from the
application during the running test.
Let use understand it with following simple example of Flight
Reservation Application:
1. Go to Start → All Programs → Quick Test Professional → Sample Applications → Flight
2. Flight Reservation window open.
3. Click on Record in QTP to record a new test.
4. Enter Date of Flight.
5. Select value from "Fly From" drop down.
6. Select value from "Fly To" drop down.
7. Click Flights.... button.
8. Flights Table window opens. Click Ok
9. Enter The Name.
10. From Class area select Business radio button.
11. Click stop in order to stop recording and Save the test.
Below is the Expert View script of above same
test:
Window("Flight Reservation").WinObject("Date of Flight:").Type "120909"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Denveer"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Frankfurit"
Window("Flight Reservation").WinButton("FLIGHTS").Click
Window("Flight Reservation").Dialog("Flight Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Names:").Set "saach"
Window("Flight Reservation").WinRadioButton("Business X").Set
Window("Flight Reservation").WinObject("Date of Flight:").Type "120909"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Denveer"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Frankfurit"
Window("Flight Reservation").WinButton("FLIGHTS").Click
Window("Flight Reservation").Dialog("Flight Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Names:").Set "saach"
Window("Flight Reservation").WinRadioButton("Business X").Set
GetRoProperty |
No comments:
Post a Comment