Well, this:
if type.to_s[0..-2].eql?('text_field')

negates this:
[:text_fields, :select_lists, :checkboxes].each do |type|

This whole section appears to accomplish nothing other than outputting 
text:
      puts "begin"
      puts "$browser.text_field(:id,'#{i.id}').set(#{p})"
      puts "rescue =>e"
      puts "end"

And you didn't answer my question. How do you know where a given value 
goes when you look at the page?

What is your ultimate goal? You seem to be taking a rather convoluted 
path there.

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