开发者

Watir :- click an image button?

开发者 https://www.devze.com 2023-03-01 20:50 出处:网络
I have am using firefox and i have modifie开发者_如何转开发d 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 butto

I have am using firefox and i have modifie开发者_如何转开发d 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消