Is there a way to with Ruby/Watir to specify an element in the browser
as a variable?

I'm trying to parse though a set of elements on the web page to get
the setting of a specific attribute for each element.

This example below  fails with the following:
   undefined method `sElement ' for #<Watir::IE:0x588b440>

How would I need to modify the failing line so that I can pass
sElement as a variable?

Here is a stripped down version of what I'm trying to do:

require 'watir'
browser = Watir::IE.new
browser.goto("http://google.com";)

aElements = [ "link", "image", "button"]  # Elements to parse

aElements.each do | sElement |
  puts("\nChecking - #{sElement}")

  # Fails here since there is no method named "sElement"
  myID = browser.sElement(:index, 1).id

  puts("ID of #{sElement}  = " + myID.to_s)
end

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: [email protected]
To unsubscribe: [email protected]

Reply via email to