3

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

luca
  • 12,311
  • 15
  • 70
  • 103

1 Answers1

3

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
  • 56,372
  • 28
  • 94
  • 125