views:

53

answers:

1

I'm using watir for safari with ruby 1.8.7 on OSX Snow leopard.

I want to click a button, the only one in the page, that has neither id nor name. It only has an onckick property and the text within the tag..

How to do that? Is there a way to list all buttons on the page, and get the first (and only) one? thanks

+1  A: 

I could help more if you have posted html of the button.

Something like this could do it:

browser.button(:index, 1).click

or

browser.button(:value, "Google Search").click

Not related to your question, but the best place for Watir questions is watir-general.

Željko Filipin