[cosmo-dev] DOM ids for wayward elements

Mikeal Rogers mikeal at osafoundation.org
Wed Dec 12 16:30:10 PST 2007


 From a testing perspective real id's have a huge advantage over the  
jspaths that result in "jsids" in tests.

Writing new tests, maintaining tests, and adding asserts and  
waitsForElement in existing tests on static id's takes a matter of  
seconds with the tools that we've built. jsids on the other hand  
require a working knowledge of the cosmo javascript code base, and  
result in calls so big we've been keeping an initialized registry in  
windmill just to make it a little more maintainable. Debugging jsids  
also require a good amount of javascript experience, which lowly  
python developers like myself lack.

mde described an earlier discussion about this, the tone of which was  
"Maintaining a js registry of paths to dynamic id's vs. Maintaining a  
spreadsheet of staticly defined ids". I honestly don't know why the  
discussion was framed this way. If you create long descriptive names  
the likely hood of stepping on the name later is fairly low, so there  
is no need to maintain a spreadsheet of names.

If the names are static test authors definitely don't need a list of  
them, the IDE has facilities to simply click on an element and grab  
it's id, and the recorder reliably picks up these id's during recorded  
actions.

-Mikea


On Dec 12, 2007, at December 12, 20074:12 PM, Travis Vachon wrote:

> Hi folks
>
> While writing these tests I've noticed we are missing DOM ids for  
> many elements, most significantly buttons in various dialogs and the  
> detail view. I have been adding semantically descriptive ids to  
> buttons as I need them, which I'll make sure to check in in more-or- 
> less their own checkin.
>
> Matthew mentioned in IRC that the lack of DOM ids is actually a  
> matter of policy rather than oversight, so I wanted to give an  
> opportunity for any concerns regarding these changes to be  
> addressed. In the future I believe it would be a good idea to  
> provide semantically descriptive ids to all DOM elements we create  
> in the UI. This will make writing windmill tests for the UI much  
> easier for people not familiar with our code base.
>
> -Travis
> _______________________________________________
> cosmo-dev mailing list
> cosmo-dev at lists.osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/cosmo-dev



More information about the cosmo-dev mailing list