From: "Mattias A." Date: 2012-12-06T05:15:46+09:00 Subject: Find element test with webdriver Hi, if my test not find the element i want it to continue and output that it was not found. But below code fails, i want my test to output ' Did not find element with id: gbgfba'. Thanks for your help in advance! (element id should be gbqfba but have entered gbqfbax so it should fail) require 'selenium-webdriver' class Find_element def initialize @driver = Selenium::WebDriver.for :firefox @driver.get "http://google.com" end def by_id #By ID - driver.find_element(:id,) if @driver.find_element(:id, "gbqfbax") puts 'Did find element with Id: gbqfba' else puts 'Did not find element with Id: gbqfba' end end end test = Find_element.new test.by_id -- Posted via http://www.ruby-forum.com/.