title: How do you get window titles, ids, and names in selenium-webdriver?
body: <p>Im trying to implement the following methods from <strong>selenium-webdriver</strong> (ruby)</p>
  
  <ul>
  <li>get_all_window_ids</li>
  <li>get_all_window_titles</li>
  <li>get_all_window_names</li>
  </ul>
  
  <ol>
  <li>I ran Selenium IDE and exported my script to Ruby Test::Unit. Saved it as .rb </li>
  <li>Opened my script for editing using Aptana Studio 3 </li>
  <li>Initial code snippet as follows:</li>
  </ol>
  
  <pre><code>require "rubygems"
  require "selenium-webdriver"
  require "test/unit"
  
  class SwitchToPopup3 &lt; Test::Unit::TestCase
  
    def setup
      @driver = Selenium::WebDriver.for :firefox
      @base_url = (URL of my test website)
      @driver.manage.timeouts.implicit_wait = 30
      @verification_errors = []
    end
  
    def teardown
      @driver.quit
      assert_equal [], @verification_errors
    end
  
  
  def test_switch_to_popup3
    .
    .
    puts @driver.get_all_window_ids()
    puts @driver.get_all_window_titles()
    puts @driver.get_all_window_names()
    .
    .
  end
  </code></pre>
  
  <p>The error I keep getting is</p>
  
  <pre><code>NoMethodError: undefined method `get_all_window_ids' for #    &lt;Selenium::WebDriver::Driver:0x101e4b040 browser=:chrome&gt;
  /Users/rsucgang/Documents/Aptana Studio 3 Workspace/Testing/SwitchToPopup2.rb:37:in `test_switch_to_popup3'
  </code></pre>
  
  <p>I've studied the documentation for the ruby bindings for selenium-webdriver</p>
  
  <p><a href="http://selenium.googlecode.com/svn/trunk/docs/api/rb/Selenium/Client/GeneratedDriver.html#get_all_window_titles-instance_method" rel="nofollow">http://selenium.googlecode.com/svn/trunk/docs/api/rb/Selenium/Client/GeneratedDriver.html#get_all_window_titles-instance_method</a></p>
  
  <p>Ultimately my goal here is to run my automation script:
  <ol>
  <li>Click on a link that opens a new window with target=_blank and no windowID available (does not implement JS)</li>
  <li>Identify the names of all opened windows in the browser</li>
  <li>switch to a new pop-up window using the switchToWindow(name) method</li>
  <li>continue running my script on that pop-up window</li>
  </ol></li></p>
  
  <p>I've googled and researched this on the internet and I have not gotten any much information.</p>
  
  <p>Thanks and please let me know if you need more information.</p>
  
  <ul>
  <li>OSL Mac OSX 10.7.3</li>
  <li>Ruby: ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]</li>
  <li>Browser: Firefox 9.0.1 (Mac)</li>
  <li>Chrome: Chrome 17.0.963.79 (Mac)</li>
  <li>Selenium-Server: Ruby gem 2.20.0</li>
  </ul>