WATIR - Clicking img

This is driving me up the wall.

I need to click on an apply button, however the Javascript has a number
of hidden buttons. You would think the developer would identify each one
uniquely but he hasn’t. Each one is:

the only difference is the onClick bit.

Any ideas as to how I can click this damn button?

I’ve tried numerous things so any help would be appreciated.


I’m not sure if this a great way of doing it, but I overrode the link
to add the :html search type:

class IE
def getLink( how, what )
[… normal code …]
when :html
links.each do |thisLink|
if what.matches(thisLink.outerHtml)
link = thisLink if link == nil
[… rest of method …]
This searches based on outer html. This could be used to find your link
based on contents in the onClick:

@ie.link(:html, /value=‘New’/).flash