I've written a ScreenScraper class that "harvests" all the HTML 
elements; textfields, checkboxes, radiobuttons, etc., from a web page 
and populates a SQL Server table. This is a process needed to fully 
automate the testing of a ASP.NET app from a data-driven approach. The 
problem is that the developers that wrote the app did not use the 
"tabindex" property on any of the controls. Had they done so, the 
ScreenScraper class could've collected that information as well and we'd 
know in what order the controls have to be populated. Although it's a 
valid test, under normal circumstances you wouldn't want to click the 
"Login" button until both a username and password are provided.

My question... Is there a way to collect a list of all the controls on a 
page _in the order they appear on the screen_? I suspect drilling into 
the DOM is going to be part of the solution. Just wondering if someone 
else has run into this issue and what they did to resolve it. No sense 
in re-inventing the wheel.

An alternative would be a Ruby script that records the mouse clicks as 
each control is clicked, stuffing the "taborder" into a table, or some 
such.

Thanks!

-- 
Posted via http://www.ruby-forum.com/.