your snippet is from lines 134-138 in element.rb   The error is originating 
on line 246

also I do not think 'click' is a valid eventname  I think you want 
'onclick'  (although the code internally seems to strip the 'on' off so 
that may not matter, still as a matter of form I prefer the code someone is 
reading have event names that match what any javascript etc would tend to 
be looking for, just so it makes more sense to any developer who might not 
know the watir internals and is looking at my code trying to debug a 
problem or fix his or my bugs or something) 

in addition to that, I'm not sure ':true' (a symbol since it starts with a 
colon) will automagically cast into a boolean, you may just want 'true' 
(sans quotes) 

On Tuesday, May 1, 2012 9:15:08 AM UTC-7, mndude wrote:
>
> Maybe because I'm new to ruby I'm reading the API docs wrong but...
>
> I'm looking at this page 
> http://jarib.github.com/watir-webdriver/doc/Watir/Element.html#fire_event-instance_method
>
> Where it says:
>
> - (Object <http://jarib.github.com/watir-webdriver/doc/Watir/Object.html>) 
> *fire_event*(event_name, bubble = false) 
> [Hide source<http://jarib.github.com/watir-webdriver/doc/Watir/Element.html#>
> ] 
>
> 134
> 135
> 136
> 137
> 138
>
>  # File 'lib/watir-webdriver/elements/element.rb', line 134
> def fire_event(event_name, bubble = false)
>   assert_exists
>   event_name = event_name.to_s.sub(/^on/, '')
>   browserbot('triggerEvent', @element, event_name, bubble)end
>
>
> But, if I try to execute fire_event with 2 arguments I get an error:
>
> irb(main):013:0> button.fire_event( 'click', :true )
> ArgumentError: wrong number of arguments (2 for 1)
>         from 
> C:/Ruby/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.5.5/lib/watir-webdriver/elements/element.rb:246:in
>  
> `fire_event'
>         from (irb):13
>         from C:/Ruby/bin/irb:12:in `<main>'
>

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

Reply via email to