Once, we embrace the idea of removing the object repositories from the automation, we can solve few issues to.
Say, we need to click on the "Add This", what are the options we have?
| Code: |
| clickElement("Add This",1) |
Here the property of "Add This" stored in object repository.
| Code: |
| fireEventOnElement("ID","addthis","Add This",1,"Click","NONE","false") |
Here the property stored in the python file.
| Code: |
| fireEventOnElement(".*","innertext","Add This",1,"Click","NONE","true") |
Here the property stored in the python and if anything changes in the tag or property of the object except innertext, this function will be played. Why only innertext? Innertext will be the one exposed in web page which means if the function didn't play back, we can identify that easily.
What about the index or more than one Add This is present in the page?
If we know that index of those Add This, we can write that function based on that. If that more Add This may added in future, we can use
| Code: |
| getElementProperty(tagName,propertyName,propertyValue,index,propertyNeeded,regExpRequired='false') |
A simple loop like one below can check that.
| Code: |
i=1
while i:
value=getElementProperty(".*","innertext",".*",i,"innertext","true")
if value=="Add This":
maxvalindex=i
i=i 1
else:
break
|
Using getElementProperty you can get the if any Add This property has been added and plan accordingly.
Rajasankar
rajasankar at zohocorp dot com
Post Comment