On 8/2/06, Andrew McFarlane <[EMAIL PROTECTED]> wrote:
> So, if I have an image button that does not have a name, id, or alt
> attribute value, but does have a src attribute value, I cannot click it?

While the comments in watir.rb are not 100% accurate, they will answer
a great many questions:

       # This is the main method for accessing images - normally an
<img src="image.gif"> HTML tag.
        #  *  how   - symbol - how we access the image, :index, :id,
:name, :src, :title or :alt are supported
        #  *  what  - string or regexp - what we are looking for
        #
        # returns an Image object
        #
        # Valid values for 'how' are
        #
        #    :index      - find the item using the index in the
container (a container can be a document, a TableCell, a Span, a Div
or a P
        #                  index is 1 based
        #    :name       - find the item using the name attribute
        #    :id         - find the item using the id attribute
        #    :alt        - finds the item using the alt text (tool tip)
        #    :src        - finds the item using the src tag. This must
be the fully qualified name, so is best used with a regular expression
        #    :xpath      - finds the item that matches xpath query
        #    :title      - finds the item using the title (tool tip)
        #
        # Typical Usage
        #
        #   ie.image(:src, /myPic/)             # access the first
image that matches myPic. We can use a string in place of the regular
expression
        #                                       # but the complete
path must be used, ie.image(:src,
'http://myserver.com/my_path/my_image.jpg')
        #   ie.image(:index,2)                  # access the second
image on the page
        #   ie.image(:alt, "A Picture")        # access an image using
the alt text
        #   ie.image(:xpath, "//[EMAIL PROTECTED]'A Picture']/")    # access
an image using the alt text
        #
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to