Nathan, I believe that in 1.5.1127, you can also loop through images and check the "class" attribute.
@ie = Watir::IE.new @ie.goto(http://somepage.com) @ie.images.each do |image| if image.attribute_value("class") == "btn_viewResults" # Image found else # This image isn't the one end end I don't think it does regular expression matches, but maybe someone can correct me if I'm wrong. Ethan On 12/7/06, Nathan <[EMAIL PROTECTED]> wrote: > Thank you Jlolis. That does help me. I was trying to do that, because I'd > seen other people do it. Here's the problem that I've come up against with > doing that. The containing web element is a div, and when I do this: > > ie.div(:id, "viewResultsButton").images > > I get an error: NoMethodError: undefined method 'document' for > #<Watir::Div:0x2dd9940>. Then when I try: > > ie.div(:id, "viewResultsButton")[1].image(:index, 1).click > > I also get an error: NoMethodError: undefined method '[]' for > #<Watir::Div:0x2dd2ed8>. I pretty much already knew that would be the case. > I'm not dumb, and the first error told me already, "forget about it!" So how > woulld one accomplish this with a div!? > > thanks, > > Nathan > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5661&messageID=15811#15811 > _______________________________________________ > Wtr-general mailing list > [email protected] > http://rubyforge.org/mailman/listinfo/wtr-general > _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
