Sie sind auf Seite 1von 4

QTP Tutorials & Interview Questions <http://qtp.blogspot.

com/>
QTP tutorials & interview questions

qtp tutorials interview questions <http://sql-plsql.blogspot.com>


QTP *QTP - Home* <http://qtp.blogspot.com>
QTP *QTP Tutorials* <http://qtp.blogspot.com/2007/07/qtp-tutorials.html>
QTP *QTP Scripts* <http://qtp.blogspot.com/2008/05/qtp-script.html>
QTP *QTP - Quick Test Professional*
<http://qtp.blogspot.com/2007/04/what-is-qtp-quicktest-professional.html>
Testing Process of QTP *QTP Testing Process*
<http://qtp.blogspot.com/2007/04/explain-testing-process-of-qtp.html>
QTP Test Object Model *Test Object Model*
<http://qtp.blogspot.com/2007/04/explain-test-object-model-test-object_962.html>
QTP Object Repositories *QTP Object Repositories*
<http://qtp.blogspot.com/2007/04/object-repositories-in-qtp-9-quicktest.html>
Descriptive Programming in QTP *Descriptive Programming in QTP*
<http://qtp.blogspot.com/2007/10/descriptive-programming-in-qtp.html>
Checkpoints in QTP *Checkpoints in QTP - Quick Test Professional*
<http://qtp.blogspot.com/2007/05/checkpoints-in-qtp-quicktest.html>
QTP Recordings *QTP Recordings*
<http://qtp.blogspot.com/2007/05/qtp-quicktest-professional-recording.html>
Parameterizing Tests in QTP *QTP Parameterize Tests*
<http://qtp.blogspot.com/2007/05/parameterizing-tests-in-qtp-quicktest.html>
QTP (Quick Test Professional) Keyword Vie *QTP (Quick Test Professional)
Keyword View*
<http://qtp.blogspot.com/2007/05/qtp-quicktest-professional-keyword-view.html>
Actions in QTP 9 (Quick Test Professional) *Actions in QTP 9 (Quick Test
Professional)*
<http://qtp.blogspot.com/2007/05/actions-in-qtp-9-quicktest-professional_08.html
>
VBScript in QTP *VBScript in QTP*
<http://qtp.blogspot.com/2007/05/vbscript-in-qtp.html>
Software Automation Framework *Software Automation Framework*
<http://qtp.blogspot.com/2007/06/choosing-test-automation-framework.html>
QTP Sync, Wait, Synchronization New *QTP Sync, Wait, Synchronization
New*
<http://qtp.blogspot.com/2007/09/qtp-sync-wait-and-synchronization.html>
All about QTP Parameters *All About QTP Parameters*
<http://qtp.blogspot.com/2007/11/qtp-parameters_12.html>
Difference between Image & Bitmap Checkpoint *Difference between Image &
Bitmap Checkpoint*
<http://qtp.blogspot.com/2007/09/image-bitmap-checkpoint-difference.html>
Action input & output Parameters *Action input & output Parameters*
<http://qtp.blogspot.com/2008/03/qtp-action-input-output-parameters.html>
Capturing Background Color in QTP *Capturing Background Color in QTP*
<http://qtp.blogspot.com/2008/02/background-color-in-qtp.html>
Object Hierarchy in QTP *Object Hierarchy in QTP*
<http://qtp.blogspot.com/2008/02/object-hierarchy-in-qtp.html>
QTP Function Libraries *QTP Function Libraries*
<http://qtp.blogspot.com/2008/01/function-library.html>
QTP GetTOProperties, GetROProperty *QTP GetTOProperties, GetROProperty*
<http://qtp.blogspot.com/2008/05/qtp-gettoproperties-getroproperty.html>
*Search more on QTP here*

QTP GetTOProperty, GetROProperty, GetTOProperties

AddThis
<http://www.addthis.com/bookmark.php?v=120&winname=addthis&pub=sachxn&source=men
-120&lng=en&s=&url=%3Cdata%3Apost.url%2F%3E&title=%3Cdata%3Apost.title%2F%3E&log
o=&logobg=&logocolor=&ate=AT-sachxn/-/-/4d7541aa717fd24b/1&uid=4d7541aa4ae95645&
CXNID=2000001.5215456080540439074NXC&tt=0>
_*GetTOProperties*_
Returns properties and values which QTP has recorded and will use to
identify an object at run time.
_*GetROProperty*_
It will Return the current value (run time value) of the test object
property from the object in the application.
*GetROProperty* retrieves the current property value of the object in
the application during the test run.
_*GetTOProperty*_
It will Return the value of a particular property for a test object
which QTP recorded to identify an object during Run time. The value is
taken from the Object Repository.
*GetTOProperty* retrieves the values of only those properties that are
included in the test object description in Object Repository by QTP.

I will show very easy to understand example of GetTOProperty,


GetROProperty, GetTOProperties on a radio button object.
Just record a simple test on Flight Reservation application.
1. Go to Start->All Programs->QuickTest Professional->Sample
Applications->Flight
2. Flight Reservation window opens.
3. Click on Record in QTP to record a new test.
4. Enter Date of Flight.
5. Select value from "Fly From" dropdown.
6. Select value from "Fly To" dropdown.
7. Click Flights... button.
8. Flights Table window opens. Click Ok
9. Enter 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 steps:
Window("Flight Reservation").WinObject("Date of Flight:").Type "120908"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Denver"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Frankfurt"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "sach"
Window("Flight Reservation").WinRadioButton("Business").Set
We did all the above steps just to enable the radio buttons in the Class
area.
From the above script which QTP recorded in Expert View, delete all the
lines, except one, which sets the Business radio button as shown below.
Window("Flight Reservation").WinRadioButton("Business").Set
Go to Resources (menu)->Object Repository. Object Repository window opens.
Click on Business radio button as shown below
<http://3.bp.blogspot.com/_Np2xL_Zaqs8/SekvHfyOznI/AAAAAAAAAXM/_OiwTkFXrXI/s1600
-h/GetTOProperties_GetROProperty.JPG>
It will show all the properties which QTP recorded for Business radio
button.
Now to view all these properties through a script (and use them later
somewhere)use GetTOProperties as below:
_GetTOProperties_
Convert the remaining one line in the Expert view like this below and
add a For Loop.
set a=Window("Flight
Reservation").WinRadioButton("Business").GetTOProperties
count_of_prop = a.Count
For i = 0 To count_of_prop - 1
Prop_Name = a(i).Name
Prop_Value = a(i).Value
MsgBox Prop_Name & " = " & Prop_Value
Next
This above code which uses GetTOProperties shows all the properties of
Business radio button which QTP recorded in order to identify it.
For GetROProperty & GetTOProperty you have to specify the property whose
value you want to retrieve.
In the same test delete or comment all of the above code
(GetTOProperties) and write the below code for GetROProperty and run the
test.
_GetROProperty_
a=Window("Flight
Reservation").WinRadioButton("Business").GetROProperty("checked")
msgbox a
Select Economy radio button and then run the above code again to see a
different value.
Again in the same test delete or comment all of the above code
(GetROProperty) and write the below code for GetTOProperty and run the test.
_GetTOProperty_
You can view the value for only those properties which QTP recorded for
a particular object.
a=Window("Flight
Reservation").WinRadioButton("Business").GetTOProperty("nativeclass")
msgbox a
a=Window("Flight
Reservation").WinRadioButton("Business").GetTOProperty("text")
msgbox a

Also See:
QTP SetTOProperty <http://qtp.blogspot.com/2010/01/qtp-settoproperty.html>
posted by Sachin Dhall | 12:30 AM
<http://qtp.blogspot.com/2008/05/qtp-gettoproperties-getroproperty.html>
(Copyright © 2006-2009) qtp.blogspot.com
Site Meter <http://www.sitemeter.com/stats.asp?site=s24saarvi>

Das könnte Ihnen auch gefallen