[Httpunit-develop] Suggestion : Getting a table by it's id attribute?
Brought to you by:
russgold
From: Mathieu G. <MGe...@no...> - 2000-12-13 18:21:02
|
Hi, I might have missed similar functionnality, but I had an idea to facilitate access to tables : add a method to get a table based on the id attribute. webResponse.getTableWithId(String id) This method would recurse into nested tables as needed to return the first table that has that id has an attribute. for example webResponse.getTableWithId("quote") would enable to easily get the following table : <table id="quote"> ...stuff... </table> The advantage would be easy access to any table, not depending on content of the table, so the content might actually change without breaking unit tests written with HTTPUnit. I took the idea from the Enhydra XMLC project (a kind of template engine, java-based) who uses id attributes to find wanted elements from HTML templates. What do you think? Mathieu |