[Wtr-general] clicking image (button?)
Charley Baker
charley.baker at gmail.com
Thu Mar 22 13:14:30 EDT 2007
Hi Parv,
You should be able to click on it with something like this:
$ie.button(:src, /\/images/prep/new/submit.jpg/).click
* $ie.image(:src, 'http://myDomain.com/images
>
> /prep/new/submit.jpg').flash()
This control is a button in Watir not an image, the full url isn't listed in
the src attribute of the image, so it needs to refer to whatever is there in
the html.
* $ie.image(:src, /submit/).flash()
It's a button, this might work depending on what else is in your html if you
use $ie.button(....)
* $ie.button(:src => /submit./, :index => 2).click()
Aha, you've now caught the fact that input elements in the latest version of
Watir don't support multiple attributes. If you'd like you can vote for this
issue in Jira as there is a ticket: http://jira.openqa.org/browse/WTR-74
Hope that helps,
Charley
On 3/22/07, Parv <forum-watir-users at openqa.org> wrote:
>
> Hi,
> Please Help, as i'm trying to click on on image (button) that fires an
> onClick() event.
>
> Here's html:
> <input type="image" src="/images/prep/new/submit.jpg" onClick="sub()">
>
> I have tried the following, but none has worked so far:
> * $ie.image(:src, 'http://myDomain.com/images/prep/new/submit.jpg').flash(
> )
> * $ie.image(:src, /submit/).flash()
> * $ie.button(:src => /submit./, :index => 2).click()
>
> Your help is highly appreciated. Thanks!!!
>
> Parv
> _______________________________________________
> Wtr-general mailing list
> Wtr-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070322/46d1a8bc/attachment.html
More information about the Wtr-general
mailing list