Whenever I have had the misfortune to maintain an automation framework that's testing a web site I generally find the following:
- A code module of some kind for testing each page.
- At the top of the module, a whole mess of links to the significant nodes under test.
These links are often extensive and require manual updates whenever a node is moved on the page.
It would save millions of hours of work each year if the browser constructed a simple database of each node as it constructs the page and provided a simple query engine, perhaps java script, to allow frameworks to query a node by a distinct tag / label and get a web element in return.
That way all test and development teams would have to do is ensure that they assign a distinct label to any node they know they'll be testing.
Then all the framework has to do is call the query engine to get the required web element, regardless of whether it has been moved or not.
As the browser is aware of each node as it builds the page, this shouldn't cause a significant overhead while loading it. However, you could also provide a test toggle to enable / disable this feature, with it being disabled by default.
This feature would save millions of lines of code world wide and make Opera a very popular browser for testers and developers.