[Wtr-general] How do you access an image that doesn't have img in the HTML tag?

Angrez Singh angrez at gmail.com
Thu Oct 5 00:48:02 EDT 2006


Hi,

Its an image button try this:

ie.button(:id, "grdCompCodes__ctl2_imgSelect").click

- Angrez


On 10/5/06, Eva <forum-watir-users at openqa.org> wrote:
>
> Typically image have this tag...
> < img id="Banner1_imgProductName" key="LogoWhite.gif"
> src="/images/LogoWhite.gif" alt="" border="0" / >
> <br><br>
> Here is the html code for the triangle image I'm trying to click on...
> <input type="image" name="grdCompCodes:_ctl2:imgSelect"
> id="grdCompCodes__ctl2_imgSelect" src="/images/SelectRow1.gif" alt=""
> border="0" />
> <br><br>
> I tried the following...
> $ie.image(:name, "grdCompCodes:_ctl2:imgSelect").click
> <br><br>
> The results in the command prompt are Unable to locate object, using name
> and grdCompCodes:_ctl2:imgSelect (Watir::Exception::UnknownObjectException)
> <br><br>
> I also tried the following...
> $ie.image(:id, "grdCompCodes__ctl2_imgSelect").click
> <br><br>
> The results were the same, except the problem was with the id.
> <br><br>
> I also tried using the index method, but it couldn't find this image. I
> don't know if this image has an index?
> <br><br>
> I know this isn't a typical image tag. I believe that is why I'm having
> these problems. Any suggestions to get this to work?
> <br><br>
> Thanks.
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.openqa.org/thread.jspa?threadID=4672&messageID=12899#12899
> _______________________________________________
> 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/20061005/d9fd1c1d/attachment.html 


More information about the Wtr-general mailing list