package com.thoughtworks.selenium;

import junit.framework.*;

import org.openqa.selenium.server.*;

public class GoogleTest extends TestCase
{
   private Selenium selenium;

   public void setUp() throws Exception {
        String url = "http://www.google.com";
       selenium = new DefaultSelenium("localhost", SeleniumServer.DEFAULT_PORT, "*firefox", url);
       selenium.start();
    }
   
   protected void tearDown() throws Exception {
       selenium.stop();
   }
   
   public void testGoogleTestSearch() throws Throwable {
		selenium.open("http://www.google.com/webhp");
		assertEquals("Google", selenium.getTitle());
		selenium.type("q", "Selenium OpenQA");
		assertEquals("Selenium OpenQA", selenium.getValue("q"));
        String s = selenium.getLogMessages();
        System.out.println(s);
		selenium.click("btnG");
		selenium.waitForPageToLoad("5000");
        assertTrue(selenium.isTextPresent("openqa.org"));
		assertEquals("Selenium OpenQA - Google Search", selenium.getTitle());
	}
	
}

@@ -571,24 +571,374 @@
 om/webhp%22);%0A
+        String%5B%5D windowNames = selenium.getAllWindowNames();%0A        for (String windowName : windowNames) %7B%0A            System.out.println(%22Window Name: %22 + windowName);%0A        %7D%0A        String%5B%5D windowIds = selenium.getAllWindowIds();%0A        for (String windowId : windowIds) %7B%0A            System.out.println(%22Window Id: %22 + windowId);%0A        %7D%0A
 %09%09assertEqua
@@ -1145,16 +1145,58 @@
 println(
+%22The log messages are the following:%5Cn%22 + 
 s);%0A%09%09se

add getAllWindowIds(), getAllWindowNames(), getAllWindowTitles()