An exception occurs when using a string or regexp value for the :tag_name 
locator.

For example, on any page, locate an element by the tag name:

````ruby
ie.element(:tag_name => 'div').exists?
#=> NoMethodError: undefined method `each' for "div":String
#=>   from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:20:in
 `each'
#=>   from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:147:in
 `locate'
#=>   from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/element.rb:33:in
 `locate'
#=>   from 
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/element.rb:359:in
 `exists?'
#=>   from (irb):3
#=>   from C:/Ruby193/bin/irb:12:in `<main>'
````

It seems that the tag_name value has to be specified as an array:

````ruby
ie.element(:tag_name => ['div']).exists?
=> true
````

For consistency with watir-webdriver, the tag_name should be able to take a 
String or Regexp value.

---
Reply to this email directly or view it on GitHub:
https://github.com/watir/watir-classic/issues/62
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to