Watir :- click an image button?

4k Views Asked by At

I have am using firefox and i have modified its user agent to make it behave like iphone web browser. now when i open google.com using watir and now i want to click on the searh button which is an image in mobile view. how to do that.

1

There are 1 best solutions below

0
On BEST ANSWER

To click an image

<img id="logo">

try this

browser.image(:id => "logo").click

If the image is actually a button

<input type="image" id="logo">

try this

browser.button(:id => "logo").click

The next time please provide relevant HTML.

Also, take a look at HTML Elements Supported by Watir page.