Having trouble with button click by id in firefox

5 views
Skip to first unread message

pmneve

unread,
Oct 22, 2010, 8:43:35 PM10/22/10
to Vapir
Here is the code:

strg = "chart-ch-holding-summary-1"
...
button = browser.button(:id, strg).


debugger shows this as the inspect value of button:

Vapir::Firefox::Button:0x0672d160 exists?: false how: :attributes
what: {:id=>"chart-ch-holding-summary-1"}

when I then try a click on it:

button.click

vapir says it doesn't exist... it found it. but says it doesn't
exist (even in the inspect above).

If I use browser.link(:text, strg), the click appears to work.

Any ideas?

am using:
ruby 1.8.6.26
rails 2.3.5
vapir-common (1.7.1)
vapir-firefox (1.7.1)
vapir-ie (1.7.1)

Thanks!
pat

Ethan

unread,
Oct 22, 2010, 9:53:23 PM10/22/10
to va...@googlegroups.com
Is the button in a frame? If so you need to locate the frame and then the button within it. 

Are you sure it's actually a button, rather than some other element (a link or a span or whatever) with css styles to make it look like a button? This means it is has a <button> tag, or <input> tag with a type attribute that is one of 'button', 'submit', 'image', 'reset'. 

Željko Filipin

unread,
Oct 25, 2010, 4:51:54 AM10/25/10
to vapir
On Sat, Oct 23, 2010 at 2:43 AM, pmneve <patrick...@gmail.com> wrote:
> Vapir::Firefox::Button:0x0672d160 exists?: false how:     :attributes
> what:    {:id=>"chart-ch-holding-summary-1"}

I think "exists?: false" means that the button does not exist, but I could be wrong. :)

Željko
--
watir.com - community manager
watirpodcast.com - host
testingpodcast.com - audio podcasts on software testing. all of them

pmneve

unread,
Oct 25, 2010, 1:50:57 PM10/25/10
to Vapir
Hmmm,
Apparently Watir::IE is more forgiving than Vapir::Firefox.

Indeed the target 'button' is really a link disguised as a button as
Ethan suggested.
using browser.link(:id, 'renderBtn') works in both.

Am actually trying both FireWatir and Vapir::Firefox to see which
works best in my situation. Will post here when I have something
concrete.

Thank you both for your reponses! Right on the money!
pat

On Oct 25, 1:51 am, Željko Filipin <zeljko.fili...@wa-research.ch>
wrote:

Ethan

unread,
Oct 25, 2010, 1:52:27 PM10/25/10
to va...@googlegroups.com
Strange, I didn't think that Watir::IE would recognize a link as a button. Good to hear you got it working, either way. 
Reply all
Reply to author
Forward
0 new messages