unknown wrote in post #1087829: > Am 04.12.2012 20:19, schrieb Mattias A.: >> ------------------- >> I did a new try with below but it insists on running the method by_id >> even if i not call it? Any ides? > > I do not think it does. Try including statements like > "puts 'method by_id'" and "puts 'method by_name'" > in the respective method. When I removed the space in def by_id it passed, it dident run the code due to the syntax error in this method. (as i understands it) > >> #By ID - driver.find_element(:id,<elementID>) >> @driver.find_element (:id, "q") > > You should remove the space before the argument parentheses > (it causes an error in Ruby 1.9.3). > > @driver.find_element(:id, "q") Thanks for your help, now it works! :D -- Posted via http://www.ruby-forum.com/.