From: Shawn Anderson Date: 2007-10-07T05:57:19+09:00 Subject: Re: WATIR - Clicking img ------=_Part_30907_16666497.1191704233669 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I'm not sure if this a great way of doing it, but I overrode the link method 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 end end [... 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 /Shawn On 9/12/07, Tracy Pyne wrote: > > 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: > > onClick="document.NewforOutputForm.mode.value='New';" > src="../images/apply_btn_1.gif" > OnMouseOver="this.src='../images/apply_btn_2.gif'" > OnMouseOut="this.src='../images/apply_btn_1.gif'" /> > > 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. > > Thanks > Tracy > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_30907_16666497.1191704233669--