diff -ru src_0.9.2/DefaultSelenium.java src_patched/DefaultSelenium.java
--- src_0.9.2/DefaultSelenium.java	2007-09-20 11:46:00.000000000 +0200
+++ src_patched/DefaultSelenium.java	2008-01-29 11:44:13.000000000 +0100
@@ -17,221 +17,221 @@
 
 // This file has been automatically generated via XSL
 package com.thoughtworks.selenium;
-
-/** The default implementation of the Selenium interface; <i>end users will primarily interact with this object.</i> */
-public class DefaultSelenium implements Selenium {
-
-	// This file has been automatically generated using XSL
-	// This part of the file is hard-coded in the XSL
-	protected CommandProcessor commandProcessor;
-	/** Uses a CommandBridgeClient, specifying a server host/port, a command to launch the browser, and a starting URL for the browser.
-     * 
-     * <p><i>browserString</i> may be any one of the following:
-     * <ul>
-     * <li><code>*firefox [absolute path]</code> - Automatically launch a new Firefox process using a custom Firefox profile.
-     * This profile will be automatically configured to use the Selenium Server as a proxy and to have all annoying prompts
-     * ("save your password?" "forms are insecure" "make Firefox your default browser?" disabled.  You may optionally specify
-     * an absolute path to your firefox executable, or just say "*firefox".  If no absolute path is specified, we'll look for
-     * firefox.exe in a default location (normally c:\program files\mozilla firefox\firefox.exe), which you can override by
-     * setting the Java system property <code>firefoxDefaultPath</code> to the correct path to Firefox.</li>
-     * <li><code>*iexplore [absolute path]</code> - Automatically launch a new Internet Explorer process using custom Windows registry settings.
-     * This process will be automatically configured to use the Selenium Server as a proxy and to have all annoying prompts
-     * ("save your password?" "forms are insecure" "make Firefox your default browser?" disabled.  You may optionally specify
-     * an absolute path to your iexplore executable, or just say "*iexplore".  If no absolute path is specified, we'll look for
-     * iexplore.exe in a default location (normally c:\program files\internet explorer\iexplore.exe), which you can override by
-     * setting the Java system property <code>iexploreDefaultPath</code> to the correct path to Internet Explorer.</li>
-     * <li><code>/path/to/my/browser [other arguments]</code> - You may also simply specify the absolute path to your browser
-     * executable, or use a relative path to your executable (which we'll try to find on your path).  <b>Warning:</b> If you
-     * specify your own custom browser, it's up to you to configure it correctly.  At a minimum, you'll need to configure your
-     * browser to use the Selenium Server as a proxy, and disable all browser-specific prompting.
-     * </ul>
-     * 
-     * @param serverHost the host name on which the Selenium Server resides
-     * @param serverPort the port on which the Selenium Server is listening
-     * @param browserString the command string used to launch the browser, e.g. "*firefox", "*iexplore" or "c:\\program files\\internet explorer\\iexplore.exe"
-     * @param browserURL the starting URL including just a domain name.  We'll start the browser pointing at the Selenium resources on this URL,
-     * e.g. "http://www.google.com" would send the browser to "http://www.google.com/selenium-server/SeleneseRunner.html"
-     */
-    public DefaultSelenium(String serverHost, int serverPort, String browserStartCommand, String browserURL) {
-        this.commandProcessor = new HttpCommandProcessor(serverHost, serverPort, browserStartCommand, browserURL);
-    }
-    
-    /** Uses an arbitrary CommandProcessor */
-    public DefaultSelenium(CommandProcessor processor) {
-        this.commandProcessor = processor;
-    }
-    
-    public void start() {
-		try {
-            commandProcessor.start();
-        }
-        catch (Exception e) {
-            if (e.getMessage().indexOf("Connection refused: connect") != -1) {
-                throw new RuntimeException("Could not contact Selenium Server; have you started it?\n" + e.getMessage());
-            }
-        }
-    }
-
-    public void stop() {
-        commandProcessor.stop();
-    }
-
-	// From here on, everything in this file has been auto-generated
-
-	public void click(String locator) {
-		commandProcessor.doCommand("click", new String[] {locator,});
+
+/** The default implementation of the Selenium interface; <i>end users will primarily interact with this object.</i> */
+public class DefaultSelenium implements Selenium {
+
+	// This file has been automatically generated using XSL
+	// This part of the file is hard-coded in the XSL
+	protected CommandProcessor commandProcessor;
+	/** Uses a CommandBridgeClient, specifying a server host/port, a command to launch the browser, and a starting URL for the browser.
+     * 
+     * <p><i>browserString</i> may be any one of the following:
+     * <ul>
+     * <li><code>*firefox [absolute path]</code> - Automatically launch a new Firefox process using a custom Firefox profile.
+     * This profile will be automatically configured to use the Selenium Server as a proxy and to have all annoying prompts
+     * ("save your password?" "forms are insecure" "make Firefox your default browser?" disabled.  You may optionally specify
+     * an absolute path to your firefox executable, or just say "*firefox".  If no absolute path is specified, we'll look for
+     * firefox.exe in a default location (normally c:\program files\mozilla firefox\firefox.exe), which you can override by
+     * setting the Java system property <code>firefoxDefaultPath</code> to the correct path to Firefox.</li>
+     * <li><code>*iexplore [absolute path]</code> - Automatically launch a new Internet Explorer process using custom Windows registry settings.
+     * This process will be automatically configured to use the Selenium Server as a proxy and to have all annoying prompts
+     * ("save your password?" "forms are insecure" "make Firefox your default browser?" disabled.  You may optionally specify
+     * an absolute path to your iexplore executable, or just say "*iexplore".  If no absolute path is specified, we'll look for
+     * iexplore.exe in a default location (normally c:\program files\internet explorer\iexplore.exe), which you can override by
+     * setting the Java system property <code>iexploreDefaultPath</code> to the correct path to Internet Explorer.</li>
+     * <li><code>/path/to/my/browser [other arguments]</code> - You may also simply specify the absolute path to your browser
+     * executable, or use a relative path to your executable (which we'll try to find on your path).  <b>Warning:</b> If you
+     * specify your own custom browser, it's up to you to configure it correctly.  At a minimum, you'll need to configure your
+     * browser to use the Selenium Server as a proxy, and disable all browser-specific prompting.
+     * </ul>
+     * 
+     * @param serverHost the host name on which the Selenium Server resides
+     * @param serverPort the port on which the Selenium Server is listening
+     * @param browserString the command string used to launch the browser, e.g. "*firefox", "*iexplore" or "c:\\program files\\internet explorer\\iexplore.exe"
+     * @param browserURL the starting URL including just a domain name.  We'll start the browser pointing at the Selenium resources on this URL,
+     * e.g. "http://www.google.com" would send the browser to "http://www.google.com/selenium-server/SeleneseRunner.html"
+     */
+    public DefaultSelenium(String serverHost, int serverPort, String browserStartCommand, String browserURL) {
+        this.commandProcessor = new HttpCommandProcessor(serverHost, serverPort, browserStartCommand, browserURL);
+    }
+    
+    /** Uses an arbitrary CommandProcessor */
+    public DefaultSelenium(CommandProcessor processor) {
+        this.commandProcessor = processor;
+    }
+    
+    public void start() {
+		try {
+            commandProcessor.start();
+        }
+        catch (Exception e) {
+            if (e.getMessage().indexOf("Connection refused: connect") != -1) {
+                throw new RuntimeException("Could not contact Selenium Server; have you started it?\n" + e.getMessage());
+            }
+        }
+    }
+
+    public void stop() {
+        commandProcessor.stop();
+    }
+
+	// From here on, everything in this file has been auto-generated
+
+	public String click(String locator) {
+		return commandProcessor.doCommand("click", new String[] {locator,});
 	}
 
-	public void doubleClick(String locator) {
-		commandProcessor.doCommand("doubleClick", new String[] {locator,});
+	public String doubleClick(String locator) {
+		return commandProcessor.doCommand("doubleClick", new String[] {locator,});
 	}
 
-	public void clickAt(String locator,String coordString) {
-		commandProcessor.doCommand("clickAt", new String[] {locator,coordString,});
+	public String clickAt(String locator,String coordString) {
+		return commandProcessor.doCommand("clickAt", new String[] {locator,coordString,});
 	}
 
-	public void doubleClickAt(String locator,String coordString) {
-		commandProcessor.doCommand("doubleClickAt", new String[] {locator,coordString,});
+	public String doubleClickAt(String locator,String coordString) {
+		return commandProcessor.doCommand("doubleClickAt", new String[] {locator,coordString,});
 	}
 
-	public void fireEvent(String locator,String eventName) {
-		commandProcessor.doCommand("fireEvent", new String[] {locator,eventName,});
+	public String fireEvent(String locator,String eventName) {
+		return commandProcessor.doCommand("fireEvent", new String[] {locator,eventName,});
 	}
 
-	public void keyPress(String locator,String keySequence) {
-		commandProcessor.doCommand("keyPress", new String[] {locator,keySequence,});
+	public String keyPress(String locator,String keySequence) {
+		return commandProcessor.doCommand("keyPress", new String[] {locator,keySequence,});
 	}
 
-	public void shiftKeyDown() {
-		commandProcessor.doCommand("shiftKeyDown", new String[] {});
+	public String shiftKeyDown() {
+		return commandProcessor.doCommand("shiftKeyDown", new String[] {});
 	}
 
-	public void shiftKeyUp() {
-		commandProcessor.doCommand("shiftKeyUp", new String[] {});
+	public String shiftKeyUp() {
+		return commandProcessor.doCommand("shiftKeyUp", new String[] {});
 	}
 
-	public void metaKeyDown() {
-		commandProcessor.doCommand("metaKeyDown", new String[] {});
+	public String metaKeyDown() {
+		return commandProcessor.doCommand("metaKeyDown", new String[] {});
 	}
 
-	public void metaKeyUp() {
-		commandProcessor.doCommand("metaKeyUp", new String[] {});
+	public String metaKeyUp() {
+		return commandProcessor.doCommand("metaKeyUp", new String[] {});
 	}
 
-	public void altKeyDown() {
-		commandProcessor.doCommand("altKeyDown", new String[] {});
+	public String altKeyDown() {
+		return commandProcessor.doCommand("altKeyDown", new String[] {});
 	}
 
-	public void altKeyUp() {
-		commandProcessor.doCommand("altKeyUp", new String[] {});
+	public String altKeyUp() {
+		return commandProcessor.doCommand("altKeyUp", new String[] {});
 	}
 
-	public void controlKeyDown() {
-		commandProcessor.doCommand("controlKeyDown", new String[] {});
+	public String controlKeyDown() {
+		return commandProcessor.doCommand("controlKeyDown", new String[] {});
 	}
 
-	public void controlKeyUp() {
-		commandProcessor.doCommand("controlKeyUp", new String[] {});
+	public String controlKeyUp() {
+		return commandProcessor.doCommand("controlKeyUp", new String[] {});
 	}
 
-	public void keyDown(String locator,String keySequence) {
-		commandProcessor.doCommand("keyDown", new String[] {locator,keySequence,});
+	public String keyDown(String locator,String keySequence) {
+		return commandProcessor.doCommand("keyDown", new String[] {locator,keySequence,});
 	}
 
-	public void keyUp(String locator,String keySequence) {
-		commandProcessor.doCommand("keyUp", new String[] {locator,keySequence,});
+	public String keyUp(String locator,String keySequence) {
+		return commandProcessor.doCommand("keyUp", new String[] {locator,keySequence,});
 	}
 
-	public void mouseOver(String locator) {
-		commandProcessor.doCommand("mouseOver", new String[] {locator,});
+	public String mouseOver(String locator) {
+		return commandProcessor.doCommand("mouseOver", new String[] {locator,});
 	}
 
-	public void mouseOut(String locator) {
-		commandProcessor.doCommand("mouseOut", new String[] {locator,});
+	public String mouseOut(String locator) {
+		return commandProcessor.doCommand("mouseOut", new String[] {locator,});
 	}
 
-	public void mouseDown(String locator) {
-		commandProcessor.doCommand("mouseDown", new String[] {locator,});
+	public String mouseDown(String locator) {
+		return commandProcessor.doCommand("mouseDown", new String[] {locator,});
 	}
 
-	public void mouseDownAt(String locator,String coordString) {
-		commandProcessor.doCommand("mouseDownAt", new String[] {locator,coordString,});
+	public String mouseDownAt(String locator,String coordString) {
+		return commandProcessor.doCommand("mouseDownAt", new String[] {locator,coordString,});
 	}
 
-	public void mouseUp(String locator) {
-		commandProcessor.doCommand("mouseUp", new String[] {locator,});
+	public String mouseUp(String locator) {
+		return commandProcessor.doCommand("mouseUp", new String[] {locator,});
 	}
 
-	public void mouseUpAt(String locator,String coordString) {
-		commandProcessor.doCommand("mouseUpAt", new String[] {locator,coordString,});
+	public String mouseUpAt(String locator,String coordString) {
+		return commandProcessor.doCommand("mouseUpAt", new String[] {locator,coordString,});
 	}
 
-	public void mouseMove(String locator) {
-		commandProcessor.doCommand("mouseMove", new String[] {locator,});
+	public String mouseMove(String locator) {
+		return commandProcessor.doCommand("mouseMove", new String[] {locator,});
 	}
 
-	public void mouseMoveAt(String locator,String coordString) {
-		commandProcessor.doCommand("mouseMoveAt", new String[] {locator,coordString,});
+	public String mouseMoveAt(String locator,String coordString) {
+		return commandProcessor.doCommand("mouseMoveAt", new String[] {locator,coordString,});
 	}
 
-	public void type(String locator,String value) {
-		commandProcessor.doCommand("type", new String[] {locator,value,});
+	public String type(String locator,String value) {
+		return commandProcessor.doCommand("type", new String[] {locator,value,});
 	}
 
-	public void typeKeys(String locator,String value) {
-		commandProcessor.doCommand("typeKeys", new String[] {locator,value,});
+	public String typeKeys(String locator,String value) {
+		return commandProcessor.doCommand("typeKeys", new String[] {locator,value,});
 	}
 
-	public void setSpeed(String value) {
-		commandProcessor.doCommand("setSpeed", new String[] {value,});
+	public String setSpeed(String value) {
+		return commandProcessor.doCommand("setSpeed", new String[] {value,});
 	}
 
-	public void getSpeed() {
-		commandProcessor.doCommand("getSpeed", new String[] {});
+	public String getSpeed() {
+		return commandProcessor.doCommand("getSpeed", new String[] {});
 	}
 
-	public void check(String locator) {
-		commandProcessor.doCommand("check", new String[] {locator,});
+	public String check(String locator) {
+		return commandProcessor.doCommand("check", new String[] {locator,});
 	}
 
-	public void uncheck(String locator) {
-		commandProcessor.doCommand("uncheck", new String[] {locator,});
+	public String uncheck(String locator) {
+		return commandProcessor.doCommand("uncheck", new String[] {locator,});
 	}
 
-	public void select(String selectLocator,String optionLocator) {
-		commandProcessor.doCommand("select", new String[] {selectLocator,optionLocator,});
+	public String select(String selectLocator,String optionLocator) {
+		return commandProcessor.doCommand("select", new String[] {selectLocator,optionLocator,});
 	}
 
-	public void addSelection(String locator,String optionLocator) {
-		commandProcessor.doCommand("addSelection", new String[] {locator,optionLocator,});
+	public String addSelection(String locator,String optionLocator) {
+		return commandProcessor.doCommand("addSelection", new String[] {locator,optionLocator,});
 	}
 
-	public void removeSelection(String locator,String optionLocator) {
-		commandProcessor.doCommand("removeSelection", new String[] {locator,optionLocator,});
+	public String removeSelection(String locator,String optionLocator) {
+		return commandProcessor.doCommand("removeSelection", new String[] {locator,optionLocator,});
 	}
 
-	public void removeAllSelections(String locator) {
-		commandProcessor.doCommand("removeAllSelections", new String[] {locator,});
+	public String removeAllSelections(String locator) {
+		return commandProcessor.doCommand("removeAllSelections", new String[] {locator,});
 	}
 
-	public void submit(String formLocator) {
-		commandProcessor.doCommand("submit", new String[] {formLocator,});
+	public String submit(String formLocator) {
+		return commandProcessor.doCommand("submit", new String[] {formLocator,});
 	}
 
-	public void open(String url) {
-		commandProcessor.doCommand("open", new String[] {url,});
+	public String open(String url) {
+		return commandProcessor.doCommand("open", new String[] {url,});
 	}
 
-	public void openWindow(String url,String windowID) {
-		commandProcessor.doCommand("openWindow", new String[] {url,windowID,});
+	public String openWindow(String url,String windowID) {
+		return commandProcessor.doCommand("openWindow", new String[] {url,windowID,});
 	}
 
-	public void selectWindow(String windowID) {
-		commandProcessor.doCommand("selectWindow", new String[] {windowID,});
+	public String selectWindow(String windowID) {
+		return commandProcessor.doCommand("selectWindow", new String[] {windowID,});
 	}
 
-	public void selectFrame(String locator) {
-		commandProcessor.doCommand("selectFrame", new String[] {locator,});
+	public String selectFrame(String locator) {
+		return commandProcessor.doCommand("selectFrame", new String[] {locator,});
 	}
 
 	public boolean getWhetherThisFrameMatchFrameExpression(String currentFrameString,String target) {
@@ -242,32 +242,32 @@
 		return commandProcessor.getBoolean("getWhetherThisWindowMatchWindowExpression", new String[] {currentWindowString,target,});
 	}
 
-	public void waitForPopUp(String windowID,String timeout) {
-		commandProcessor.doCommand("waitForPopUp", new String[] {windowID,timeout,});
+	public String waitForPopUp(String windowID,String timeout) {
+		return commandProcessor.doCommand("waitForPopUp", new String[] {windowID,timeout,});
 	}
 
-	public void chooseCancelOnNextConfirmation() {
-		commandProcessor.doCommand("chooseCancelOnNextConfirmation", new String[] {});
+	public String chooseCancelOnNextConfirmation() {
+		return commandProcessor.doCommand("chooseCancelOnNextConfirmation", new String[] {});
 	}
 
-	public void chooseOkOnNextConfirmation() {
-		commandProcessor.doCommand("chooseOkOnNextConfirmation", new String[] {});
+	public String chooseOkOnNextConfirmation() {
+		return commandProcessor.doCommand("chooseOkOnNextConfirmation", new String[] {});
 	}
 
-	public void answerOnNextPrompt(String answer) {
-		commandProcessor.doCommand("answerOnNextPrompt", new String[] {answer,});
+	public String answerOnNextPrompt(String answer) {
+		return commandProcessor.doCommand("answerOnNextPrompt", new String[] {answer,});
 	}
 
-	public void goBack() {
-		commandProcessor.doCommand("goBack", new String[] {});
+	public String goBack() {
+		return commandProcessor.doCommand("goBack", new String[] {});
 	}
 
-	public void refresh() {
-		commandProcessor.doCommand("refresh", new String[] {});
+	public String refresh() {
+		return commandProcessor.doCommand("refresh", new String[] {});
 	}
 
-	public void close() {
-		commandProcessor.doCommand("close", new String[] {});
+	public String close() {
+		return commandProcessor.doCommand("close", new String[] {});
 	}
 
 	public boolean isAlertPresent() {
@@ -314,8 +314,8 @@
 		return commandProcessor.getString("getText", new String[] {locator,});
 	}
 
-	public void highlight(String locator) {
-		commandProcessor.doCommand("highlight", new String[] {locator,});
+	public String highlight(String locator) {
+		return commandProcessor.doCommand("highlight", new String[] {locator,});
 	}
 
 	public String getEval(String script) {
@@ -406,32 +406,32 @@
 		return commandProcessor.getStringArray("getAttributeFromAllWindows", new String[] {attributeName,});
 	}
 
-	public void dragdrop(String locator,String movementsString) {
-		commandProcessor.doCommand("dragdrop", new String[] {locator,movementsString,});
+	public String dragdrop(String locator,String movementsString) {
+		return commandProcessor.doCommand("dragdrop", new String[] {locator,movementsString,});
 	}
 
-	public void setMouseSpeed(String pixels) {
-		commandProcessor.doCommand("setMouseSpeed", new String[] {pixels,});
+	public String setMouseSpeed(String pixels) {
+		return commandProcessor.doCommand("setMouseSpeed", new String[] {pixels,});
 	}
 
 	public Number getMouseSpeed() {
 		return commandProcessor.getNumber("getMouseSpeed", new String[] {});
 	}
 
-	public void dragAndDrop(String locator,String movementsString) {
-		commandProcessor.doCommand("dragAndDrop", new String[] {locator,movementsString,});
+	public String dragAndDrop(String locator,String movementsString) {
+		return commandProcessor.doCommand("dragAndDrop", new String[] {locator,movementsString,});
 	}
 
-	public void dragAndDropToObject(String locatorOfObjectToBeDragged,String locatorOfDragDestinationObject) {
-		commandProcessor.doCommand("dragAndDropToObject", new String[] {locatorOfObjectToBeDragged,locatorOfDragDestinationObject,});
+	public String dragAndDropToObject(String locatorOfObjectToBeDragged,String locatorOfDragDestinationObject) {
+		return commandProcessor.doCommand("dragAndDropToObject", new String[] {locatorOfObjectToBeDragged,locatorOfDragDestinationObject,});
 	}
 
-	public void windowFocus() {
-		commandProcessor.doCommand("windowFocus", new String[] {});
+	public String windowFocus() {
+		return commandProcessor.doCommand("windowFocus", new String[] {});
 	}
 
-	public void windowMaximize() {
-		commandProcessor.doCommand("windowMaximize", new String[] {});
+	public String windowMaximize() {
+		return commandProcessor.doCommand("windowMaximize", new String[] {});
 	}
 
 	public String[] getAllWindowIds() {
@@ -450,8 +450,8 @@
 		return commandProcessor.getString("getHtmlSource", new String[] {});
 	}
 
-	public void setCursorPosition(String locator,String position) {
-		commandProcessor.doCommand("setCursorPosition", new String[] {locator,position,});
+	public String setCursorPosition(String locator,String position) {
+		return commandProcessor.doCommand("setCursorPosition", new String[] {locator,position,});
 	}
 
 	public Number getElementIndex(String locator) {
@@ -490,60 +490,60 @@
 		return commandProcessor.getNumber("getXpathCount", new String[] {xpath,});
 	}
 
-	public void assignId(String locator,String identifier) {
-		commandProcessor.doCommand("assignId", new String[] {locator,identifier,});
+	public String assignId(String locator,String identifier) {
+		return commandProcessor.doCommand("assignId", new String[] {locator,identifier,});
 	}
 
-	public void allowNativeXpath(String allow) {
-		commandProcessor.doCommand("allowNativeXpath", new String[] {allow,});
+	public String allowNativeXpath(String allow) {
+		return commandProcessor.doCommand("allowNativeXpath", new String[] {allow,});
 	}
 
-	public void waitForCondition(String script,String timeout) {
-		commandProcessor.doCommand("waitForCondition", new String[] {script,timeout,});
+	public String waitForCondition(String script,String timeout) {
+		return commandProcessor.doCommand("waitForCondition", new String[] {script,timeout,});
 	}
 
-	public void setTimeout(String timeout) {
-		commandProcessor.doCommand("setTimeout", new String[] {timeout,});
+	public String setTimeout(String timeout) {
+		return commandProcessor.doCommand("setTimeout", new String[] {timeout,});
 	}
 
-	public void waitForPageToLoad(String timeout) {
-		commandProcessor.doCommand("waitForPageToLoad", new String[] {timeout,});
+	public String waitForPageToLoad(String timeout) {
+		return commandProcessor.doCommand("waitForPageToLoad", new String[] {timeout,});
 	}
 
-	public void waitForFrameToLoad(String frameAddress,String timeout) {
-		commandProcessor.doCommand("waitForFrameToLoad", new String[] {frameAddress,timeout,});
+	public String waitForFrameToLoad(String frameAddress,String timeout) {
+		return commandProcessor.doCommand("waitForFrameToLoad", new String[] {frameAddress,timeout,});
 	}
 
 	public String getCookie() {
 		return commandProcessor.getString("getCookie", new String[] {});
 	}
 
-	public void createCookie(String nameValuePair,String optionsString) {
-		commandProcessor.doCommand("createCookie", new String[] {nameValuePair,optionsString,});
+	public String createCookie(String nameValuePair,String optionsString) {
+		return commandProcessor.doCommand("createCookie", new String[] {nameValuePair,optionsString,});
 	}
 
-	public void deleteCookie(String name,String path) {
-		commandProcessor.doCommand("deleteCookie", new String[] {name,path,});
+	public String deleteCookie(String name,String path) {
+		return commandProcessor.doCommand("deleteCookie", new String[] {name,path,});
 	}
 
-	public void setBrowserLogLevel(String logLevel) {
-		commandProcessor.doCommand("setBrowserLogLevel", new String[] {logLevel,});
+	public String setBrowserLogLevel(String logLevel) {
+		return commandProcessor.doCommand("setBrowserLogLevel", new String[] {logLevel,});
 	}
 
-	public void runScript(String script) {
-		commandProcessor.doCommand("runScript", new String[] {script,});
+	public String runScript(String script) {
+		return commandProcessor.doCommand("runScript", new String[] {script,});
 	}
 
-	public void addLocationStrategy(String strategyName,String functionDefinition) {
-		commandProcessor.doCommand("addLocationStrategy", new String[] {strategyName,functionDefinition,});
+	public String addLocationStrategy(String strategyName,String functionDefinition) {
+		return commandProcessor.doCommand("addLocationStrategy", new String[] {strategyName,functionDefinition,});
 	}
 
-	public void setContext(String context) {
-		commandProcessor.doCommand("setContext", new String[] {context,});
+	public String setContext(String context) {
+		return commandProcessor.doCommand("setContext", new String[] {context,});
 	}
 
-	public void captureScreenshot(String filename) {
-		commandProcessor.doCommand("captureScreenshot", new String[] {filename,});
+	public String captureScreenshot(String filename) {
+		return commandProcessor.doCommand("captureScreenshot", new String[] {filename,});
 	}
 
-}
\ No newline at end of file
+}
Only in src_0.9.2: selenium_0.9.2.patch
diff -ru src_0.9.2/SeleniumDriverResourceHandler.java src_patched/SeleniumDriverResourceHandler.java
--- src_0.9.2/SeleniumDriverResourceHandler.java	2008-01-22 16:02:46.000000000 +0100
+++ src_patched/SeleniumDriverResourceHandler.java	2008-01-23 18:16:01.000000000 +0100
@@ -36,6 +36,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.StringTokenizer;
 import java.util.Vector;
 
 import javax.imageio.ImageIO;
@@ -406,7 +407,11 @@
             shutDown(res);
         } else if ("captureScreenshot".equals(cmd)) {
             try {
-                captureScreenshot(values.get(0));
+                if (values.size() >= 2) {
+                    captureScreenshot(values.get(0), values.get(1));
+                } else {
+                    captureScreenshot(values.get(0));
+                }
                 results = "OK";
             } catch (Exception e) {
                 log.error("Problem capturing screenshot", e);
@@ -490,6 +495,41 @@
         
     }
 
+    private void captureScreenshot(String fileName, String geometry) throws AWTException, IOException, NumberFormatException {
+        Robot robot = new Robot();
+        int width=10, height=10, originX=0, originY=0;
+        String s;
+        // mirror line: geometry = "%dx%d+%d+%d" % (width, height, originX, originY)
+        // e.g. "1200x600+10+20"
+        StringTokenizer st = new StringTokenizer(geometry, "x", false);
+        if (st.hasMoreTokens()) {
+            s = st.nextToken(); // "1200"
+            width = Integer.parseInt(s);
+        };
+        if (st.hasMoreTokens()) {
+            s = st.nextToken(); // "600+10+20"
+            st = new StringTokenizer(s, "+", false);
+            if (st.hasMoreTokens()) {
+                s = st.nextToken(); // "600"
+                height = Integer.parseInt(s);
+            }
+            if (st.hasMoreTokens()) {
+                s = st.nextToken(); // "10"
+                originX = Integer.parseInt(s);
+            }
+            if (st.hasMoreTokens()) {
+                s = st.nextToken(); // "20"
+                originY = Integer.parseInt(s);
+            }
+        };
+        // assert(Integer(width, height, originX, originY))
+        Rectangle captureSize = new Rectangle(originX, originY, width, height);
+        BufferedImage bufferedImage = robot.createScreenCapture(captureSize);
+        File outFile = new File(fileName);
+        ImageIO.write(bufferedImage, "png", outFile);
+        
+    }
+
     private void shutDown(HttpResponse res) {
         log.info("Shutdown command received");
         
diff -ru src_0.9.2/Selenium.java src_patched/Selenium.java
--- src_0.9.2/Selenium.java	2007-09-20 11:46:00.000000000 +0200
+++ src_patched/Selenium.java	2007-12-18 17:02:19.000000000 +0100
@@ -74,14 +74,14 @@
 waitForPageToLoad.
 @param locator an element locator
 */
-void click(String locator);
+String click(String locator);
 
 /** Double clicks on a link, button, checkbox or radio button. If the double click action
 causes a new page to load (like a link usually does), call
 waitForPageToLoad.
 @param locator an element locator
 */
-void doubleClick(String locator);
+String doubleClick(String locator);
 
 /** Clicks on a link, button, checkbox or radio button. If the click action
 causes a new page to load (like a link usually does), call
@@ -89,7 +89,7 @@
 @param locator an element locator
 @param coordString specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
 */
-void clickAt(String locator,String coordString);
+String clickAt(String locator,String coordString);
 
 /** Doubleclicks on a link, button, checkbox or radio button. If the action
 causes a new page to load (like a link usually does), call
@@ -97,113 +97,113 @@
 @param locator an element locator
 @param coordString specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
 */
-void doubleClickAt(String locator,String coordString);
+String doubleClickAt(String locator,String coordString);
 
 /** Explicitly simulate an event, to trigger the corresponding "on<em>event</em>"
 handler.
 @param locator an <a href="#locators">element locator</a>
 @param eventName the event name, e.g. "focus" or "blur"
 */
-void fireEvent(String locator,String eventName);
+String fireEvent(String locator,String eventName);
 
 /** Simulates a user pressing and releasing a key.
 @param locator an <a href="#locators">element locator</a>
 @param keySequence Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".
 */
-void keyPress(String locator,String keySequence);
+String keyPress(String locator,String keySequence);
 
 /** Press the shift key and hold it down until doShiftUp() is called or a new page is loaded.
 */
-void shiftKeyDown();
+String shiftKeyDown();
 
 /** Release the shift key.
 */
-void shiftKeyUp();
+String shiftKeyUp();
 
 /** Press the meta key and hold it down until doMetaUp() is called or a new page is loaded.
 */
-void metaKeyDown();
+String metaKeyDown();
 
 /** Release the meta key.
 */
-void metaKeyUp();
+String metaKeyUp();
 
 /** Press the alt key and hold it down until doAltUp() is called or a new page is loaded.
 */
-void altKeyDown();
+String altKeyDown();
 
 /** Release the alt key.
 */
-void altKeyUp();
+String altKeyUp();
 
 /** Press the control key and hold it down until doControlUp() is called or a new page is loaded.
 */
-void controlKeyDown();
+String controlKeyDown();
 
 /** Release the control key.
 */
-void controlKeyUp();
+String controlKeyUp();
 
 /** Simulates a user pressing a key (without releasing it yet).
 @param locator an <a href="#locators">element locator</a>
 @param keySequence Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".
 */
-void keyDown(String locator,String keySequence);
+String keyDown(String locator,String keySequence);
 
 /** Simulates a user releasing a key.
 @param locator an <a href="#locators">element locator</a>
 @param keySequence Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".
 */
-void keyUp(String locator,String keySequence);
+String keyUp(String locator,String keySequence);
 
 /** Simulates a user hovering a mouse over the specified element.
 @param locator an <a href="#locators">element locator</a>
 */
-void mouseOver(String locator);
+String mouseOver(String locator);
 
 /** Simulates a user moving the mouse pointer away from the specified element.
 @param locator an <a href="#locators">element locator</a>
 */
-void mouseOut(String locator);
+String mouseOut(String locator);
 
 /** Simulates a user pressing the mouse button (without releasing it yet) on
 the specified element.
 @param locator an <a href="#locators">element locator</a>
 */
-void mouseDown(String locator);
+String mouseDown(String locator);
 
 /** Simulates a user pressing the mouse button (without releasing it yet) at
 the specified location.
 @param locator an <a href="#locators">element locator</a>
 @param coordString specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
 */
-void mouseDownAt(String locator,String coordString);
+String mouseDownAt(String locator,String coordString);
 
 /** Simulates the event that occurs when the user releases the mouse button (i.e., stops
 holding the button down) on the specified element.
 @param locator an <a href="#locators">element locator</a>
 */
-void mouseUp(String locator);
+String mouseUp(String locator);
 
 /** Simulates the event that occurs when the user releases the mouse button (i.e., stops
 holding the button down) at the specified location.
 @param locator an <a href="#locators">element locator</a>
 @param coordString specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
 */
-void mouseUpAt(String locator,String coordString);
+String mouseUpAt(String locator,String coordString);
 
 /** Simulates a user pressing the mouse button (without releasing it yet) on
 the specified element.
 @param locator an <a href="#locators">element locator</a>
 */
-void mouseMove(String locator);
+String mouseMove(String locator);
 
 /** Simulates a user pressing the mouse button (without releasing it yet) on
 the specified element.
 @param locator an <a href="#locators">element locator</a>
 @param coordString specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
 */
-void mouseMoveAt(String locator,String coordString);
+String mouseMoveAt(String locator,String coordString);
 
 /** Sets the value of an input field, as though you typed it in.
 
@@ -212,7 +212,7 @@
 @param locator an <a href="#locators">element locator</a>
 @param value the value to type
 */
-void type(String locator,String value);
+String type(String locator,String value);
 
 /** Simulates keystroke events on the specified element, as though you typed the value key-by-key.
 
@@ -225,30 +225,30 @@
 @param locator an <a href="#locators">element locator</a>
 @param value the value to type
 */
-void typeKeys(String locator,String value);
+String typeKeys(String locator,String value);
 
 /** Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation).  By default, there is no such delay, i.e.,
 the delay is 0 milliseconds.
 @param value the number of milliseconds to pause after operation
 */
-void setSpeed(String value);
+String setSpeed(String value);
 
 /** Get execution speed (i.e., get the millisecond length of the delay following each selenium operation).  By default, there is no such delay, i.e.,
 the delay is 0 milliseconds.
 
 See also setSpeed.
 */
-void getSpeed();
+String getSpeed();
 
 /** Check a toggle-button (checkbox/radio)
 @param locator an <a href="#locators">element locator</a>
 */
-void check(String locator);
+String check(String locator);
 
 /** Uncheck a toggle-button (checkbox/radio)
 @param locator an <a href="#locators">element locator</a>
 */
-void uncheck(String locator);
+String uncheck(String locator);
 
 /** Select an option from a drop-down using an option locator.
 
@@ -273,7 +273,7 @@
 @param selectLocator an <a href="#locators">element locator</a> identifying a drop-down menu
 @param optionLocator an option locator (a label by default)
 */
-void select(String selectLocator,String optionLocator);
+String select(String selectLocator,String optionLocator);
 
 /** Add a selection to the set of selected options in a multi-select element using an option locator.
 
@@ -281,7 +281,7 @@
 @param locator an <a href="#locators">element locator</a> identifying a multi-select box
 @param optionLocator an option locator (a label by default)
 */
-void addSelection(String locator,String optionLocator);
+String addSelection(String locator,String optionLocator);
 
 /** Remove a selection from the set of selected options in a multi-select element using an option locator.
 
@@ -289,18 +289,18 @@
 @param locator an <a href="#locators">element locator</a> identifying a multi-select box
 @param optionLocator an option locator (a label by default)
 */
-void removeSelection(String locator,String optionLocator);
+String removeSelection(String locator,String optionLocator);
 
 /** Unselects all of the selected options in a multi-select element.
 @param locator an <a href="#locators">element locator</a> identifying a multi-select box
 */
-void removeAllSelections(String locator);
+String removeAllSelections(String locator);
 
 /** Submit the specified form. This is particularly useful for forms without
 submit buttons, e.g. single-input "Search" forms.
 @param formLocator an <a href="#locators">element locator</a> for the form you want to submit
 */
-void submit(String formLocator);
+String submit(String formLocator);
 
 /** Opens an URL in the test frame. This accepts both relative and absolute
 URLs.
@@ -314,7 +314,7 @@
 new browser session on that domain.
 @param url the URL to open; may be relative or absolute
 */
-void open(String url);
+String open(String url);
 
 /** Opens a popup window (if a window with that ID isn't already open).
 After opening the window, you'll need to select it using the selectWindow
@@ -326,7 +326,7 @@
 @param url the URL to open, which can be blank
 @param windowID the JavaScript window ID of the window to select
 */
-void openWindow(String url,String windowID);
+String openWindow(String url,String windowID);
 
 /** Selects a popup window; once a popup window has been selected, all
 commands go to that window. To select the main window again, use null
@@ -345,7 +345,7 @@
 an empty (blank) url, like this: openWindow("", "myFunnyWindow").</p>
 @param windowID the JavaScript window ID of the window to select
 */
-void selectWindow(String windowID);
+String selectWindow(String windowID);
 
 /** Selects a frame within the current window.  (You may invoke this command
 multiple times to select nested frames.)  To select the parent frame, use
@@ -357,7 +357,7 @@
 like this: <code>dom=frames["main"].frames["subframe"]</code></p>
 @param locator an <a href="#locators">element locator</a> identifying a frame or iframe
 */
-void selectFrame(String locator);
+String selectFrame(String locator);
 
 /** Determine whether current/locator identify the frame containing this running code.
 
@@ -389,7 +389,7 @@
 @param windowID the JavaScript window ID of the window that will appear
 @param timeout a timeout in milliseconds, after which the action will return with an error
 */
-void waitForPopUp(String windowID,String timeout);
+String waitForPopUp(String windowID,String timeout);
 
 /** By default, Selenium's overridden window.confirm() function will
 return true, as if the user had manually clicked OK; after running
@@ -399,7 +399,7 @@
 true (OK) unless/until you explicitly call this command for each
 confirmation.
 */
-void chooseCancelOnNextConfirmation();
+String chooseCancelOnNextConfirmation();
 
 /** Undo the effect of calling chooseCancelOnNextConfirmation.  Note
 that Selenium's overridden window.confirm() function will normally automatically
@@ -410,26 +410,26 @@
 true (OK) unless/until you explicitly call chooseCancelOnNextConfirmation for each
 confirmation.
 */
-void chooseOkOnNextConfirmation();
+String chooseOkOnNextConfirmation();
 
 /** Instructs Selenium to return the specified answer string in response to
 the next JavaScript prompt [window.prompt()].
 @param answer the answer to give in response to the prompt pop-up
 */
-void answerOnNextPrompt(String answer);
+String answerOnNextPrompt(String answer);
 
 /** Simulates the user clicking the "back" button on their browser.
 */
-void goBack();
+String goBack();
 
 /** Simulates the user clicking the "Refresh" button on their browser.
 */
-void refresh();
+String refresh();
 
 /** Simulates the user clicking the "close" button in the titlebar of a popup
 window or tab.
 */
-void close();
+String close();
 
 /** Has an alert occurred?
 
@@ -539,7 +539,7 @@
 /** Briefly changes the backgroundColor of the specified element yellow.  Useful for debugging.
 @param locator an <a href="#locators">element locator</a>
 */
-void highlight(String locator);
+String highlight(String locator);
 
 /** Gets the result of evaluating the specified JavaScript snippet.  The snippet may
 have multiple lines, but only the result of the last line will be returned.
@@ -693,7 +693,7 @@
 @param locator an element locator
 @param movementsString offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"
 */
-void dragdrop(String locator,String movementsString);
+String dragdrop(String locator,String movementsString);
 
 /** Configure the number of pixels between "mousemove" events during dragAndDrop commands (default=10).
 <p>Setting this value to 0 means that we'll send a "mousemove" event to every single pixel
@@ -702,7 +702,7 @@
 just send one "mousemove" at the start location and then one final one at the end location.</p>
 @param pixels the number of pixels between "mousemove" events
 */
-void setMouseSpeed(String pixels);
+String setMouseSpeed(String pixels);
 
 /** Returns the number of pixels between "mousemove" events during dragAndDrop commands (default=10).
 @return the number of pixels between "mousemove" events during dragAndDrop commands (default=10)
@@ -713,21 +713,21 @@
 @param locator an element locator
 @param movementsString offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"
 */
-void dragAndDrop(String locator,String movementsString);
+String dragAndDrop(String locator,String movementsString);
 
 /** Drags an element and drops it on another element
 @param locatorOfObjectToBeDragged an element to be dragged
 @param locatorOfDragDestinationObject an element whose location (i.e., whose center-most pixel) will be the point where locatorOfObjectToBeDragged  is dropped
 */
-void dragAndDropToObject(String locatorOfObjectToBeDragged,String locatorOfDragDestinationObject);
+String dragAndDropToObject(String locatorOfObjectToBeDragged,String locatorOfDragDestinationObject);
 
 /** Gives focus to the currently selected window
 */
-void windowFocus();
+String windowFocus();
 
 /** Resize currently selected window to take up the entire screen
 */
-void windowMaximize();
+String windowMaximize();
 
 /** Returns the IDs of all windows that the browser knows about.
 @return the IDs of all windows that the browser knows about.
@@ -755,7 +755,7 @@
 @param locator an <a href="#locators">element locator</a> pointing to an input element or textarea
 @param position the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field.  You can also set the cursor to -1 to move it to the end of the field.
 */
-void setCursorPosition(String locator,String position);
+String setCursorPosition(String locator,String position);
 
 /** Get the relative index of an element to its parent (starting from 0). The comment node and empty text node
 will be ignored.
@@ -828,7 +828,7 @@
 @param locator an <a href="#locators">element locator</a> pointing to an element
 @param identifier a string to be used as the ID of the specified element
 */
-void assignId(String locator,String identifier);
+String assignId(String locator,String identifier);
 
 /** Specifies whether Selenium should use the native in-browser implementation
 of XPath (if any native version is available); if you pass "false" to
@@ -838,7 +838,7 @@
 version is much slower than the native implementations.
 @param allow boolean, true means we'll prefer to use native XPath; false means we'll only use JS XPath
 */
-void allowNativeXpath(String allow);
+String allowNativeXpath(String allow);
 
 /** Runs the specified JavaScript snippet repeatedly until it evaluates to "true".
 The snippet may have multiple lines, but only the result of the last line
@@ -851,7 +851,7 @@
 @param script the JavaScript snippet to run
 @param timeout a timeout in milliseconds, after which this command will return with an error
 */
-void waitForCondition(String script,String timeout);
+String waitForCondition(String script,String timeout);
 
 /** Specifies the amount of time that Selenium will wait for actions to complete.
 
@@ -859,7 +859,7 @@
 The default timeout is 30 seconds.
 @param timeout a timeout in milliseconds, after which the action will return with an error
 */
-void setTimeout(String timeout);
+String setTimeout(String timeout);
 
 /** Waits for a new page to load.
 
@@ -870,7 +870,7 @@
 wait immediately after a Selenium command that caused a page-load.</p>
 @param timeout a timeout in milliseconds, after which this command will return with an error
 */
-void waitForPageToLoad(String timeout);
+String waitForPageToLoad(String timeout);
 
 /** Waits for a new frame to load.
 
@@ -881,7 +881,7 @@
 @param frameAddress FrameAddress from the server side
 @param timeout a timeout in milliseconds, after which this command will return with an error
 */
-void waitForFrameToLoad(String frameAddress,String timeout);
+String waitForFrameToLoad(String frameAddress,String timeout);
 
 /** Return all cookies of the current page under test.
 @return all cookies of the current page under test
@@ -893,13 +893,13 @@
 @param nameValuePair name and value of the cookie in a format "name=value"
 @param optionsString options for the cookie. Currently supported options include 'path' and 'max_age'.      the optionsString's format is "path=/path/, max_age=60". The order of options are irrelevant, the unit      of the value of 'max_age' is second.
 */
-void createCookie(String nameValuePair,String optionsString);
+String createCookie(String nameValuePair,String optionsString);
 
 /** Delete a named cookie with specified path.
 @param name the name of the cookie to be deleted
 @param path the path property of the cookie to be deleted
 */
-void deleteCookie(String name,String path);
+String deleteCookie(String name,String path);
 
 /** Sets the threshold for browser-side logging messages; log messages beneath this threshold will be discarded.
 Valid logLevel strings are: "debug", "info", "warn", "error" or "off".
@@ -907,7 +907,7 @@
 either show the log window in GUI mode, or enable browser-side logging in Selenium RC.
 @param logLevel one of the following: "debug", "info", "warn", "error" or "off"
 */
-void setBrowserLogLevel(String logLevel);
+String setBrowserLogLevel(String logLevel);
 
 /** Creates a new "script" tag in the body of the current test window, and 
 adds the specified text into the body of the command.  Scripts run in
@@ -918,7 +918,7 @@
 an exception.
 @param script the JavaScript snippet to run
 */
-void runScript(String script);
+String runScript(String script);
 
 /** Defines a new function for Selenium to locate elements on the page.
 For example,
@@ -933,17 +933,17 @@
 @param strategyName the name of the strategy to define; this should use only   letters [a-zA-Z] with no spaces or other punctuation.
 @param functionDefinition a string defining the body of a function in JavaScript.   For example: <code>return inDocument.getElementById(locator);</code>
 */
-void addLocationStrategy(String strategyName,String functionDefinition);
+String addLocationStrategy(String strategyName,String functionDefinition);
 
 /** Writes a message to the status bar and adds a note to the browser-side
 log.
 @param context the message to be sent to the browser
 */
-void setContext(String context);
+String setContext(String context);
 
 /** Captures a PNG screenshot to the specified file.
 @param filename the absolute path to the file to be written, e.g. "c:\blah\screenshot.png"
 */
-void captureScreenshot(String filename);
+String captureScreenshot(String filename);
 
-}
\ No newline at end of file
+}
diff -ru src_0.9.2/selenium.py src_patched/selenium.py
--- src_0.9.2/selenium.py	2007-09-20 12:22:00.000000000 +0200
+++ src_patched/selenium.py	2008-01-29 10:19:47.000000000 +0100
@@ -151,103 +151,103 @@
     If no pattern prefix is specified, Selenium assumes that it's a "glob"
     pattern.
     
-    
-    """
-
-### This part is hard-coded in the XSL
-    def __init__(self, host, port, browserStartCommand, browserURL):
-        self.host = host
-        self.port = port
-        self.browserStartCommand = browserStartCommand
-        self.browserURL = browserURL
-        self.sessionId = None
-
-    def start(self):
-        result = self.get_string("getNewBrowserSession", [self.browserStartCommand, self.browserURL])
-        try:
-            self.sessionId = long(result)
-        except ValueError:
-            raise Exception, result
-        
-    def stop(self):
-        self.do_command("testComplete", [])
-        self.sessionId = None
-
-    def do_command(self, verb, args):
-        conn = httplib.HTTPConnection(self.host, self.port)
-        commandString = u'/selenium-server/driver/?cmd=' + urllib.quote_plus(unicode(verb).encode('utf-8'))
-        for i in range(len(args)):
-            commandString = commandString + '&' + unicode(i+1) + '=' + urllib.quote_plus(unicode(args[i]).encode('utf-8'))
-        if (None != self.sessionId):
-            commandString = commandString + "&sessionId=" + unicode(self.sessionId)
-        conn.request("GET", commandString)
-    
-        response = conn.getresponse()
-        #print response.status, response.reason
-        data = unicode(response.read(), "UTF-8")
-        result = response.reason
-        #print "Selenium Result: " + repr(data) + "\n\n"
-        if (not data.startswith('OK')):
-            raise Exception, data
-        return data
-    
-    def get_string(self, verb, args):
-        result = self.do_command(verb, args)
-        return result[3:]
-    
-    def get_string_array(self, verb, args):
-        csv = self.get_string(verb, args)
-        token = ""
-        tokens = []
-        escape = False
-        for i in range(len(csv)):
-            letter = csv[i]
-            if (escape):
-                token = token + letter
-                escape = False
-                continue
-            if (letter == '\\'):
-                escape = True
-            elif (letter == ','):
-                tokens.append(token)
-                token = ""
-            else:
-                token = token + letter
-        tokens.append(token)
-        return tokens
-
-    def get_number(self, verb, args):
-        # Is there something I need to do here?
-        return self.get_string(verb, args)
-    
-    def get_number_array(self, verb, args):
-        # Is there something I need to do here?
-        return self.get_string_array(verb, args)
-
-    def get_boolean(self, verb, args):
-        boolstr = self.get_string(verb, args)
-        if ("true" == boolstr):
-            return True
-        if ("false" == boolstr):
-            return False
-        raise ValueError, "result is neither 'true' nor 'false': " + boolstr
-    
-    def get_boolean_array(self, verb, args):
-        boolarr = self.get_string_array(verb, args)
-        for i in range(len(boolarr)):
-            if ("true" == boolstr):
-                boolarr[i] = True
-                continue
-            if ("false" == boolstr):
-                boolarr[i] = False
-                continue
-            raise ValueError, "result is neither 'true' nor 'false': " + boolarr[i]
-        return boolarr
-    
-    
-
-### From here on, everything's auto-generated from XML
-
+    
+    """
+
+### This part is hard-coded in the XSL
+    def __init__(self, host, port, browserStartCommand, browserURL):
+        self.host = host
+        self.port = port
+        self.browserStartCommand = browserStartCommand
+        self.browserURL = browserURL
+        self.sessionId = None
+
+    def start(self):
+        result = self.get_string("getNewBrowserSession", [self.browserStartCommand, self.browserURL])
+        try:
+            self.sessionId = long(result)
+        except ValueError:
+            raise Exception, result
+        
+    def stop(self):
+        self.do_command("testComplete", [])
+        self.sessionId = None
+
+    def do_command(self, verb, args):
+        conn = httplib.HTTPConnection(self.host, self.port)
+        commandString = u'/selenium-server/driver/?cmd=' + urllib.quote_plus(unicode(verb).encode('utf-8'))
+        for i in range(len(args)):
+            commandString = commandString + '&' + unicode(i+1) + '=' + urllib.quote_plus(unicode(args[i]).encode('utf-8'))
+        if (None != self.sessionId):
+            commandString = commandString + "&sessionId=" + unicode(self.sessionId)
+        conn.request("GET", commandString)
+    
+        response = conn.getresponse()
+        #print response.status, response.reason
+        data = unicode(response.read(), "UTF-8")
+        result = response.reason
+        #print "Selenium Result: " + repr(data) + "\n\n"
+        if (not data.startswith('OK')):
+            raise Exception, data
+        return data
+    
+    def get_string(self, verb, args):
+        result = self.do_command(verb, args)
+        return result[3:]
+    
+    def get_string_array(self, verb, args):
+        csv = self.get_string(verb, args)
+        token = ""
+        tokens = []
+        escape = False
+        for i in range(len(csv)):
+            letter = csv[i]
+            if (escape):
+                token = token + letter
+                escape = False
+                continue
+            if (letter == '\\'):
+                escape = True
+            elif (letter == ','):
+                tokens.append(token)
+                token = ""
+            else:
+                token = token + letter
+        tokens.append(token)
+        return tokens
+
+    def get_number(self, verb, args):
+        # Is there something I need to do here?
+        return self.get_string(verb, args)
+    
+    def get_number_array(self, verb, args):
+        # Is there something I need to do here?
+        return self.get_string_array(verb, args)
+
+    def get_boolean(self, verb, args):
+        boolstr = self.get_string(verb, args)
+        if ("true" == boolstr):
+            return True
+        if ("false" == boolstr):
+            return False
+        raise ValueError, "result is neither 'true' nor 'false': " + boolstr
+    
+    def get_boolean_array(self, verb, args):
+        boolarr = self.get_string_array(verb, args)
+        for i in range(len(boolarr)):
+            if ("true" == boolstr):
+                boolarr[i] = True
+                continue
+            if ("false" == boolstr):
+                boolarr[i] = False
+                continue
+            raise ValueError, "result is neither 'true' nor 'false': " + boolarr[i]
+        return boolarr
+    
+    
+
+### From here on, everything's auto-generated from XML
+
 
     def click(self,locator):
         """
@@ -257,7 +257,7 @@
         
         'locator' is an element locator
         """
-        self.do_command("click", [locator,])
+        return self.do_command("click", [locator,])
 
 
     def double_click(self,locator):
@@ -268,7 +268,7 @@
         
         'locator' is an element locator
         """
-        self.do_command("doubleClick", [locator,])
+        return self.do_command("doubleClick", [locator,])
 
 
     def click_at(self,locator,coordString):
@@ -280,7 +280,7 @@
         'locator' is an element locator
         'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
         """
-        self.do_command("clickAt", [locator,coordString,])
+        return self.do_command("clickAt", [locator,coordString,])
 
 
     def double_click_at(self,locator,coordString):
@@ -292,7 +292,7 @@
         'locator' is an element locator
         'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
         """
-        self.do_command("doubleClickAt", [locator,coordString,])
+        return self.do_command("doubleClickAt", [locator,coordString,])
 
 
     def fire_event(self,locator,eventName):
@@ -303,7 +303,7 @@
         'locator' is an element locator
         'eventName' is the event name, e.g. "focus" or "blur"
         """
-        self.do_command("fireEvent", [locator,eventName,])
+        return self.do_command("fireEvent", [locator,eventName,])
 
 
     def key_press(self,locator,keySequence):
@@ -313,7 +313,7 @@
         'locator' is an element locator
         'keySequence' is Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".
         """
-        self.do_command("keyPress", [locator,keySequence,])
+        return self.do_command("keyPress", [locator,keySequence,])
 
 
     def shift_key_down(self):
@@ -321,7 +321,7 @@
         Press the shift key and hold it down until doShiftUp() is called or a new page is loaded.
         
         """
-        self.do_command("shiftKeyDown", [])
+        return self.do_command("shiftKeyDown", [])
 
 
     def shift_key_up(self):
@@ -329,7 +329,7 @@
         Release the shift key.
         
         """
-        self.do_command("shiftKeyUp", [])
+        return self.do_command("shiftKeyUp", [])
 
 
     def meta_key_down(self):
@@ -337,7 +337,7 @@
         Press the meta key and hold it down until doMetaUp() is called or a new page is loaded.
         
         """
-        self.do_command("metaKeyDown", [])
+        return self.do_command("metaKeyDown", [])
 
 
     def meta_key_up(self):
@@ -345,7 +345,7 @@
         Release the meta key.
         
         """
-        self.do_command("metaKeyUp", [])
+        return self.do_command("metaKeyUp", [])
 
 
     def alt_key_down(self):
@@ -353,7 +353,7 @@
         Press the alt key and hold it down until doAltUp() is called or a new page is loaded.
         
         """
-        self.do_command("altKeyDown", [])
+        return self.do_command("altKeyDown", [])
 
 
     def alt_key_up(self):
@@ -361,7 +361,7 @@
         Release the alt key.
         
         """
-        self.do_command("altKeyUp", [])
+        return self.do_command("altKeyUp", [])
 
 
     def control_key_down(self):
@@ -369,7 +369,7 @@
         Press the control key and hold it down until doControlUp() is called or a new page is loaded.
         
         """
-        self.do_command("controlKeyDown", [])
+        return self.do_command("controlKeyDown", [])
 
 
     def control_key_up(self):
@@ -377,7 +377,7 @@
         Release the control key.
         
         """
-        self.do_command("controlKeyUp", [])
+        return self.do_command("controlKeyUp", [])
 
 
     def key_down(self,locator,keySequence):
@@ -387,7 +387,7 @@
         'locator' is an element locator
         'keySequence' is Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".
         """
-        self.do_command("keyDown", [locator,keySequence,])
+        return self.do_command("keyDown", [locator,keySequence,])
 
 
     def key_up(self,locator,keySequence):
@@ -397,7 +397,7 @@
         'locator' is an element locator
         'keySequence' is Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".
         """
-        self.do_command("keyUp", [locator,keySequence,])
+        return self.do_command("keyUp", [locator,keySequence,])
 
 
     def mouse_over(self,locator):
@@ -406,7 +406,7 @@
         
         'locator' is an element locator
         """
-        self.do_command("mouseOver", [locator,])
+        return self.do_command("mouseOver", [locator,])
 
 
     def mouse_out(self,locator):
@@ -415,7 +415,7 @@
         
         'locator' is an element locator
         """
-        self.do_command("mouseOut", [locator,])
+        return self.do_command("mouseOut", [locator,])
 
 
     def mouse_down(self,locator):
@@ -425,7 +425,7 @@
         
         'locator' is an element locator
         """
-        self.do_command("mouseDown", [locator,])
+        return self.do_command("mouseDown", [locator,])
 
 
     def mouse_down_at(self,locator,coordString):
@@ -436,7 +436,7 @@
         'locator' is an element locator
         'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
         """
-        self.do_command("mouseDownAt", [locator,coordString,])
+        return self.do_command("mouseDownAt", [locator,coordString,])
 
 
     def mouse_up(self,locator):
@@ -446,7 +446,7 @@
         
         'locator' is an element locator
         """
-        self.do_command("mouseUp", [locator,])
+        return self.do_command("mouseUp", [locator,])
 
 
     def mouse_up_at(self,locator,coordString):
@@ -457,7 +457,7 @@
         'locator' is an element locator
         'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
         """
-        self.do_command("mouseUpAt", [locator,coordString,])
+        return self.do_command("mouseUpAt", [locator,coordString,])
 
 
     def mouse_move(self,locator):
@@ -467,7 +467,7 @@
         
         'locator' is an element locator
         """
-        self.do_command("mouseMove", [locator,])
+        return self.do_command("mouseMove", [locator,])
 
 
     def mouse_move_at(self,locator,coordString):
@@ -478,7 +478,7 @@
         'locator' is an element locator
         'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.
         """
-        self.do_command("mouseMoveAt", [locator,coordString,])
+        return self.do_command("mouseMoveAt", [locator,coordString,])
 
 
     def type(self,locator,value):
@@ -493,7 +493,7 @@
         'locator' is an element locator
         'value' is the value to type
         """
-        self.do_command("type", [locator,value,])
+        return self.do_command("type", [locator,value,])
 
 
     def type_keys(self,locator,value):
@@ -516,7 +516,7 @@
         'locator' is an element locator
         'value' is the value to type
         """
-        self.do_command("typeKeys", [locator,value,])
+        return self.do_command("typeKeys", [locator,value,])
 
 
     def set_speed(self,value):
@@ -526,7 +526,7 @@
         
         'value' is the number of milliseconds to pause after operation
         """
-        self.do_command("setSpeed", [value,])
+        return self.do_command("setSpeed", [value,])
 
 
     def get_speed(self):
@@ -537,7 +537,7 @@
         See also setSpeed.
         
         """
-        self.do_command("getSpeed", [])
+        return self.do_command("getSpeed", [])
 
 
     def check(self,locator):
@@ -546,7 +546,7 @@
         
         'locator' is an element locator
         """
-        self.do_command("check", [locator,])
+        return self.do_command("check", [locator,])
 
 
     def uncheck(self,locator):
@@ -555,7 +555,7 @@
         
         'locator' is an element locator
         """
-        self.do_command("uncheck", [locator,])
+        return self.do_command("uncheck", [locator,])
 
 
     def select(self,selectLocator,optionLocator):
@@ -606,7 +606,7 @@
         'selectLocator' is an element locator identifying a drop-down menu
         'optionLocator' is an option locator (a label by default)
         """
-        self.do_command("select", [selectLocator,optionLocator,])
+        return self.do_command("select", [selectLocator,optionLocator,])
 
 
     def add_selection(self,locator,optionLocator):
@@ -618,7 +618,7 @@
         'locator' is an element locator identifying a multi-select box
         'optionLocator' is an option locator (a label by default)
         """
-        self.do_command("addSelection", [locator,optionLocator,])
+        return self.do_command("addSelection", [locator,optionLocator,])
 
 
     def remove_selection(self,locator,optionLocator):
@@ -630,7 +630,7 @@
         'locator' is an element locator identifying a multi-select box
         'optionLocator' is an option locator (a label by default)
         """
-        self.do_command("removeSelection", [locator,optionLocator,])
+        return self.do_command("removeSelection", [locator,optionLocator,])
 
 
     def remove_all_selections(self,locator):
@@ -639,7 +639,7 @@
         
         'locator' is an element locator identifying a multi-select box
         """
-        self.do_command("removeAllSelections", [locator,])
+        return self.do_command("removeAllSelections", [locator,])
 
 
     def submit(self,formLocator):
@@ -649,7 +649,7 @@
         
         'formLocator' is an element locator for the form you want to submit
         """
-        self.do_command("submit", [formLocator,])
+        return self.do_command("submit", [formLocator,])
 
 
     def open(self,url):
@@ -667,7 +667,7 @@
         
         'url' is the URL to open; may be relative or absolute
         """
-        self.do_command("open", [url,])
+        return self.do_command("open", [url,])
 
 
     def open_window(self,url,windowID):
@@ -685,7 +685,7 @@
         'url' is the URL to open, which can be blank
         'windowID' is the JavaScript window ID of the window to select
         """
-        self.do_command("openWindow", [url,windowID,])
+        return self.do_command("openWindow", [url,windowID,])
 
 
     def select_window(self,windowID):
@@ -726,7 +726,7 @@
         
         'windowID' is the JavaScript window ID of the window to select
         """
-        self.do_command("selectWindow", [windowID,])
+        return self.do_command("selectWindow", [windowID,])
 
 
     def select_frame(self,locator):
@@ -744,7 +744,7 @@
         
         'locator' is an element locator identifying a frame or iframe
         """
-        self.do_command("selectFrame", [locator,])
+        return self.do_command("selectFrame", [locator,])
 
 
     def get_whether_this_frame_match_frame_expression(self,currentFrameString,target):
@@ -790,7 +790,7 @@
         'windowID' is the JavaScript window ID of the window that will appear
         'timeout' is a timeout in milliseconds, after which the action will return with an error
         """
-        self.do_command("waitForPopUp", [windowID,timeout,])
+        return self.do_command("waitForPopUp", [windowID,timeout,])
 
 
     def choose_cancel_on_next_confirmation(self):
@@ -804,7 +804,7 @@
         confirmation.
         
         """
-        self.do_command("chooseCancelOnNextConfirmation", [])
+        return self.do_command("chooseCancelOnNextConfirmation", [])
 
 
     def choose_ok_on_next_confirmation(self):
@@ -819,7 +819,7 @@
         confirmation.
         
         """
-        self.do_command("chooseOkOnNextConfirmation", [])
+        return self.do_command("chooseOkOnNextConfirmation", [])
 
 
     def answer_on_next_prompt(self,answer):
@@ -829,7 +829,7 @@
         
         'answer' is the answer to give in response to the prompt pop-up
         """
-        self.do_command("answerOnNextPrompt", [answer,])
+        return self.do_command("answerOnNextPrompt", [answer,])
 
 
     def go_back(self):
@@ -837,7 +837,7 @@
         Simulates the user clicking the "back" button on their browser.
         
         """
-        self.do_command("goBack", [])
+        return self.do_command("goBack", [])
 
 
     def refresh(self):
@@ -845,7 +845,7 @@
         Simulates the user clicking the "Refresh" button on their browser.
         
         """
-        self.do_command("refresh", [])
+        return self.do_command("refresh", [])
 
 
     def close(self):
@@ -854,7 +854,7 @@
         window or tab.
         
         """
-        self.do_command("close", [])
+        return self.do_command("close", [])
 
 
     def is_alert_present(self):
@@ -1025,7 +1025,7 @@
         
         'locator' is an element locator
         """
-        self.do_command("highlight", [locator,])
+        return self.do_command("highlight", [locator,])
 
 
     def get_eval(self,script):
@@ -1259,7 +1259,7 @@
         'locator' is an element locator
         'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"
         """
-        self.do_command("dragdrop", [locator,movementsString,])
+        return self.do_command("dragdrop", [locator,movementsString,])
 
 
     def set_mouse_speed(self,pixels):
@@ -1276,7 +1276,7 @@
         
         'pixels' is the number of pixels between "mousemove" events
         """
-        self.do_command("setMouseSpeed", [pixels,])
+        return self.do_command("setMouseSpeed", [pixels,])
 
 
     def get_mouse_speed(self):
@@ -1294,7 +1294,7 @@
         'locator' is an element locator
         'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"
         """
-        self.do_command("dragAndDrop", [locator,movementsString,])
+        return self.do_command("dragAndDrop", [locator,movementsString,])
 
 
     def drag_and_drop_to_object(self,locatorOfObjectToBeDragged,locatorOfDragDestinationObject):
@@ -1304,7 +1304,7 @@
         'locatorOfObjectToBeDragged' is an element to be dragged
         'locatorOfDragDestinationObject' is an element whose location (i.e., whose center-most pixel) will be the point where locatorOfObjectToBeDragged  is dropped
         """
-        self.do_command("dragAndDropToObject", [locatorOfObjectToBeDragged,locatorOfDragDestinationObject,])
+        return self.do_command("dragAndDropToObject", [locatorOfObjectToBeDragged,locatorOfDragDestinationObject,])
 
 
     def window_focus(self):
@@ -1312,7 +1312,7 @@
         Gives focus to the currently selected window
         
         """
-        self.do_command("windowFocus", [])
+        return self.do_command("windowFocus", [])
 
 
     def window_maximize(self):
@@ -1320,7 +1320,7 @@
         Resize currently selected window to take up the entire screen
         
         """
-        self.do_command("windowMaximize", [])
+        return self.do_command("windowMaximize", [])
 
 
     def get_all_window_ids(self):
@@ -1364,7 +1364,7 @@
         'locator' is an element locator pointing to an input element or textarea
         'position' is the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field.  You can also set the cursor to -1 to move it to the end of the field.
         """
-        self.do_command("setCursorPosition", [locator,position,])
+        return self.do_command("setCursorPosition", [locator,position,])
 
 
     def get_element_index(self,locator):
@@ -1472,7 +1472,7 @@
         'locator' is an element locator pointing to an element
         'identifier' is a string to be used as the ID of the specified element
         """
-        self.do_command("assignId", [locator,identifier,])
+        return self.do_command("assignId", [locator,identifier,])
 
 
     def allow_native_xpath(self,allow):
@@ -1486,7 +1486,7 @@
         
         'allow' is boolean, true means we'll prefer to use native XPath; false means we'll only use JS XPath
         """
-        self.do_command("allowNativeXpath", [allow,])
+        return self.do_command("allowNativeXpath", [allow,])
 
 
     def wait_for_condition(self,script,timeout):
@@ -1505,7 +1505,7 @@
         'script' is the JavaScript snippet to run
         'timeout' is a timeout in milliseconds, after which this command will return with an error
         """
-        self.do_command("waitForCondition", [script,timeout,])
+        return self.do_command("waitForCondition", [script,timeout,])
 
 
     def set_timeout(self,timeout):
@@ -1519,7 +1519,7 @@
         
         'timeout' is a timeout in milliseconds, after which the action will return with an error
         """
-        self.do_command("setTimeout", [timeout,])
+        return self.do_command("setTimeout", [timeout,])
 
 
     def wait_for_page_to_load(self,timeout):
@@ -1538,7 +1538,7 @@
         
         'timeout' is a timeout in milliseconds, after which this command will return with an error
         """
-        self.do_command("waitForPageToLoad", [timeout,])
+        return self.do_command("waitForPageToLoad", [timeout,])
 
 
     def wait_for_frame_to_load(self,frameAddress,timeout):
@@ -1555,7 +1555,7 @@
         'frameAddress' is FrameAddress from the server side
         'timeout' is a timeout in milliseconds, after which this command will return with an error
         """
-        self.do_command("waitForFrameToLoad", [frameAddress,timeout,])
+        return self.do_command("waitForFrameToLoad", [frameAddress,timeout,])
 
 
     def get_cookie(self):
@@ -1574,7 +1574,7 @@
         'nameValuePair' is name and value of the cookie in a format "name=value"
         'optionsString' is options for the cookie. Currently supported options include 'path' and 'max_age'.      the optionsString's format is "path=/path/, max_age=60". The order of options are irrelevant, the unit      of the value of 'max_age' is second.
         """
-        self.do_command("createCookie", [nameValuePair,optionsString,])
+        return self.do_command("createCookie", [nameValuePair,optionsString,])
 
 
     def delete_cookie(self,name,path):
@@ -1584,7 +1584,7 @@
         'name' is the name of the cookie to be deleted
         'path' is the path property of the cookie to be deleted
         """
-        self.do_command("deleteCookie", [name,path,])
+        return self.do_command("deleteCookie", [name,path,])
 
 
     def set_browser_log_level(self,logLevel):
@@ -1596,7 +1596,7 @@
         
         'logLevel' is one of the following: "debug", "info", "warn", "error" or "off"
         """
-        self.do_command("setBrowserLogLevel", [logLevel,])
+        return self.do_command("setBrowserLogLevel", [logLevel,])
 
 
     def run_script(self,script):
@@ -1611,7 +1611,7 @@
         
         'script' is the JavaScript snippet to run
         """
-        self.do_command("runScript", [script,])
+        return self.do_command("runScript", [script,])
 
 
     def add_location_strategy(self,strategyName,functionDefinition):
@@ -1635,7 +1635,7 @@
         'strategyName' is the name of the strategy to define; this should use only   letters [a-zA-Z] with no spaces or other punctuation.
         'functionDefinition' is a string defining the body of a function in JavaScript.   For example: ``return inDocument.getElementById(locator);``
         """
-        self.do_command("addLocationStrategy", [strategyName,functionDefinition,])
+        return self.do_command("addLocationStrategy", [strategyName,functionDefinition,])
 
 
     def set_context(self,context):
@@ -1645,7 +1645,7 @@
         
         'context' is the message to be sent to the browser
         """
-        self.do_command("setContext", [context,])
+        return self.do_command("setContext", [context,])
 
 
     def capture_screenshot(self,filename):
@@ -1654,5 +1654,5 @@
         
         'filename' is the absolute path to the file to be written, e.g. "c:\blah\screenshot.png"
         """
-        self.do_command("captureScreenshot", [filename,])
+        return self.do_command("captureScreenshot", [filename,])
 
