From: "Mattias A." Date: 2012-11-28T06:06:32+09:00 Subject: Re: Ruby + Selenium-webdriver Mattias A. wrote in post #1086723: > Joel Pearson wrote in post #1086551: >> I recommend using Watir-Webdriver, as this is Selenium with a great >> interface. >> >> Check out tips and examples here: >> http://watirwebdriver.com/ >> >> Plenty of methods are shown there and in the documentation. As for >> catching missing elements, you have methods such as "present?" returning >> a boolean value. > > Thank you Joel I will check this out. > > Best Regards > Mattias Hi again, What actually happens below? See my comments after # Would really appreciate if someone wanted to take the time to explain. require 'rubygems' #lib? require 'selenium-webdriver' #lib? driver = Selenium::WebDriver.for :firefox #instantiate driver with Selenium and Webdriver methods? driver.get "http://google.com" element = driver.find_element :name => "q" # What happens here? :name => "q"? element.send_keys "Cheese!" element.submit puts "Page title is #{driver.title}" wait = Selenium::WebDriver::Wait.new(:timeout => 2)#Wait is a new class? wait.until { driver.title.downcase.start_with? "cheese!" }#Verify that cheese has been printed? puts "Page title is #{driver.title}" driver.quit Best Regards Mattias -- Posted via http://www.ruby-forum.com/.