Am 04.12.2012 18:43, schrieb Mattias A.:
> 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,<elementID>)
>      @driver.find_element(:id, "q")
>      puts "Page title is #{@driver.title}"
>    end
>
> test = Find_element.new
> test.by_id
> end

First, you have a misplaced `end' (the last one).

I cannot reproduce your error messages, but for me the
code results in a TimeOut error, because there is no element
with id='q'. Changing :id to :name works fine (or try with
an id that actually exists on the page).


-- 
<https://github.com/stomar/>