Search This Blog

Friday, January 21, 2011

SetTo Property,GetToProperty & GetRoProperty

SetToProperty : SetToProperty change the value of test object during runtime. For example while testing a web application "name" property of web button was "Login" but in next release it changes to "Sign-In" but chnage is only for one build only & you got build very frequently so if you run your test , it will fail as in OR "name" is set as "Login" & in object it is "Sign-In". By using "SetToProperty" you can change its name property to "Login" to  again & pass you test.
This chnaged value is applicable for duration of test run only & does not affect OR,Active screen etc.Basic use of this property is when you dont want to add same type of multiple objects with different property description.

GetToProperty : GetToProperty is used to reterive the property value of test object during run time.

GetRoProperty : GetRoProperty methos is used to reterive runtime properties.

systemutil.Run "C:\Program Files\Internet Explorer\iexplore.exe" , "http://www.google.co.in/"
iname= browser("iGoogle").Page("iGoogle").GetROProperty("title")
'##############Using GetRoProperty method to reterive "name" property of Editbox.###########
iwebeditname= Browser("iGoogle").Page("iGoogle").WebEdit("q").GetROProperty("name")
msgbox iwebeditname
'##############Using SetRoProperty method to set "name" property of Editbox as Neeraj.###########
Browser("iGoogle").Page("iGoogle").WebEdit("q").SetToProperty  "name", "Neeraj"
igetro=Browser("iGoogle").Page("iGoogle").WebEdit("q").gettoproperty ("name")
msgbox igetro '######## Check if "name" Proerty value is changed or not.##########
Browser("iGoogle").Page("iGoogle").WebEdit("q").Set "neeraj"
Browser("iGoogle").Page("iGoogle").WebButton("Google Search").Click
Browser("iGoogle").Page("neeraj - Google Search").Sync

1 comment:

  1. SetTOproperty:

    This method is used to set the value of a particular property of an object in the object repository.

    ReplyDelete