@Joel need one more help! Actually I am trying to open the the new pages 
in a new tabs,instead of a new window. Accordingly I wrote this code :-

I took help from here - http://preferential.mozdev.org/preferences.html

require 'selenium-webdriver'

profile = Selenium::WebDriver::Firefox::Profile.new
profile['browser.tabs.opentabfor.windowopen'] = true

driver = Selenium::WebDriver.for :firefox,:profile => profile
driver.navigate.to "http://en.wikipedia.org/wiki/Cascading_Style_Sheets"

link_arr = driver.find_elements(:xpath,"//a")[2..3]
link_arr.map!{|e| e.attribute("href")}

link_arr.each do |link|
     driver.execute_script("window.open(\"#{link}\",'_blank')") if link
end


But still they are being opened in a new window. How to resolve this ?

-- 
Posted via http://www.ruby-forum.com/.