Click on html element

Hi, I need to click on an html element using watir and firewatir, for
example:
<td>A</td>
Since this is not a button or a link... how can I do it?

···

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

No ideas?

···

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

I tested with this html:

<html>
<body>
<div id="theDiv" onClick="alert('clicked')">
Click me !
</div>
</body>
</html>

and this code worked for me:

irb(main):006:0> ff =
FireWatir::Firefox.start("file:///home/jesus/temp/click_div.html")
=> #<FireWatir::Firefox:0x..fb6e55edc
url="file:///home/jesus/temp/click_div.html" title="">
irb(main):008:0> ff.div(:id, "theDiv")
=> #<FireWatir::Div:0x..fb6e471ac located=false how=:id what="theDiv">
irb(main):009:0> ff.div(:id, "theDiv").exists?
=> true
irb(main):010:0> ff.div(:id, "theDiv").click

This opened the alert in my Firefox window, so the div was clicked.

You can look at the FireWatir documentation here to see how you can
get a reference to the <td> element you want:

http://wtr.rubyforge.org/rdoc/1.6.5/

I think there are methods to get any HTML element, such as table, cell
and so on.

Jesus.

···

On Wed, Aug 18, 2010 at 1:30 PM, Mario Ruiz <tcblues@gmail.com> wrote:

No ideas?