Safariwatir: how to choose an anonymous button

I use watir for ruby ​​safari 1.8.7 on Snow Snow Snow OSX.

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

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

+3
source share
1 answer

I could help more if you posted the html buttons.

Something like this might do this:

browser.button(:index, 1).click

or

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

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

+3
source

Source: https://habr.com/ru/post/1733664/


All Articles