From: Joel Pearson Date: 2012-12-11T04:28:04+09:00 Subject: Re: Find element test with webdriver I meant something like this: array = @driver.find_elements(:id, "gbqfba") puts 'Did not find element' if array.size = 0 As for whether the element exists to be found you'll need to ensure that it's actually the ID you need to identify it. I recommend using Firebug as it will give you the names, IDs, even the full XPath of any element. Use the Interactive Ruby console (IRB) to test out what works in real-time. For example, this is what I'd do in watir-webdriver: irb(main):001:0> require 'watir-webdriver' => true irb(main):002:0> b = Watir::Browser.new => # irb(main):003:0> b.goto 'www.google.com' => "http://www.google.co.uk/" irb(main):004:0> b.element(:id,'gbqfba').exists? => true -- Posted via http://www.ruby-forum.com/.