Example of SetToProperty, What is SetToProperty
What is SetToProperty ?
SetToProperty change the property of an instance saved in the
Object Repository. However these change are not the permanent But
even then these are fixed.
Actually SetToProperty changes the values of testing object during
the run-time. For an example when test a web apps “Names”
property of web control was “Login” but in another step it change
to 'Sign Up' but changes are only to single build only and you
achieved build very freely so if you execute your tests, It will
definitely fails as in OR 'Names' is set to 'Login' and in instance
it is 'Singn Up'.By using 'SetToProperty' you can changed it property
name to 'Login' to again and pass your testing.
This changed value is applicable on all duration of testing
execution only and does never affect or, Enable screen etc. Basic use
for this properties is if you do not like to add same type of several
object with different -2 property description.
Simple Example of SetTOProperty
We opened a new tests in QTP and opened Calculator (Start → All Programs → Accessories → Calculator). We started The Recording in QTP.
We clicked on button (7), then button (+), now button (3) and finally or lastly button (=). Then Finally We will close the Calculator. It Will record the first six lines of the script as screen below. We added the following lines then after.
Object Repository displays that the text property of control named "7" have a value of 7.
We opened a new tests in QTP and opened Calculator (Start → All Programs → Accessories → Calculator). We started The Recording in QTP.
We clicked on button (7), then button (+), now button (3) and finally or lastly button (=). Then Finally We will close the Calculator. It Will record the first six lines of the script as screen below. We added the following lines then after.
Object Repository displays that the text property of control named "7" have a value of 7.
SetToProperty |
No comments:
Post a Comment