はい、それを実証するために、以下のコードを書きました:-
require 'selenium-webdriver'
driver = Selenium::WebDriver.for :firefox
driver.navigate.to "http://en.wikipedia.org/wiki/Cascading_Style_Sheets"
link_arr = driver.find_elements(:xpath,"//a")[2..4]
link_arr.map!{|e| e.attribute("href")}
link_arr.each do |link|
driver.execute_script("window.open(\"#{link}\")") if link
end
p driver.window_handles.size # => 4
# the below will give you the title of each opened window
p driver.window_handles.map{|d| driver.switch_to.window(d);driver.title}
# => ["Cascading Style Sheets - Wikipedia, the free encyclopedia",
#"Wiki Loves Monuments India | The Wikipedia photo contest around Cultural Heritage",
#"Wiki Loves Monuments India | The Wikipedia photo contest around Cultural Heritage",
#"Cascading Style Sheets - Wikipedia, the free encyclopedia"]
このようにして、任意のブラウザ ウィンドウに移動し、作業を完了してウィンドウを閉じることもできます。