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

Richard Conroy richard.conroy at gmail.com
Thu Oct 5 16:09:17 EDT 2006


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" />

ie.image(:src, "/images/SelectRow1.gif")

Eva, I take it that this image alters when you click on it, or gets all
funky due to the javascript.

I had the same problem with javascript toggling something open and
closed (different graphics)

You could also get an array of all the images in the page and click
on it by index

ie.images[1].click #or equivalent


More information about the Wtr-general mailing list