title: How to click a button element in watir?
body: <p>Can I write watir code to click this button element?</p>
  
  <p>The onclick event has to be triggered. </p>
  
  <pre><code>&lt;button onclick="wizardAction('start', 'Starte Upgrade')"&gt;
      &lt;table align="center" cellspacing="0"&gt;
          &lt;tbody&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;img src="/static/images/stock/gtk-ok.png" align="left" height="16" width="16"&gt;&lt;/td&gt;
                  &lt;td nowrap="nowrap"&gt;Starte Upgrade&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;/button&gt;
  </code></pre>
  
  <p><strong>Edit:</strong></p>
  
  <p>I tried it this way:</p>
  
  <pre><code>ie.button(:onclick, /start/).click
  </code></pre>
  
  <p>But it seems <em>onclick</em> is not supported:</p>
  
  <pre><code>&gt; ruby upgrade-module.rb
  
  c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/locator.rb:143:in `match?':
   onclick is an unknown way of finding an &lt;INPUT&gt; element ((?-mix:start)) (Watir:
  :Exception::MissingWayOfFindingObjectException)
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/locator.rb:126
  :in `locate'
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/locator.rb:124
  :in `each'
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/locator.rb:124
  :in `locate'
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/locator.rb:122
  :in `catch'
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/locator.rb:122
  :in `locate'
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/locator.rb:119
  :in `each'
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/locator.rb:119
  :in `locate'
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/container.rb:8
  04:in `locate_input_element'
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements
  .rb:5:in `locate'
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:53:
  in `assert_exists'
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:288
  :in `enabled?'
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:60:
  in `assert_enabled'
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:233
  :in `click!'
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:219
  :in `click'
          from upgrade-module.rb:19
  </code></pre>