Thanks, the following code works very well for images.
How about buttons, drop down list boxes, text boxes.
 
Thanks,
Sikander


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adam Reed
Sent: Monday, November 06, 2006 8:57 PM
To: [email protected]
Subject: Re: [Wtr-general] Is there any way to get all the scr's of images?

I'd use a simple ie-do loop:
 
ie = Watir::IE.new
ie.set_fast_speed
ie.goto "www.google.com"
 
    ie.images.each do |image|
        images = {'path' => image.src}
        images.each do | ite, image |
            puts "#{ite}:#{image}"
        end
    end
 
This should output:
 
path:http://www.google.com/images/logo.gif
path:http://www.google.com/images/x2.gif
 
Put a little "def Check_images" and add another "end" afterwards, and there's your function.

Thanks,
Adam

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sikander
Sent: Saturday, November 04, 2006 12:00 AM
To: [email protected]
Subject: [Wtr-general] Is there any way to get all the scr's of images?

Hi All!
 
Is there any way to get all buttons, text boxes, images etc., of a page to display?
For Example i want to see all id's or :src's of images of a web page.
In that case i may write similar to following code to display all the images of the current page one by one
check_Images=$ie.image(:src, /*.jpg/)
pust check_Images.
Please help me in this regard.
 
Regards,
Sikander
 
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to