I've come across an oddity in my functional tests for a GWT application I am working on.
The Selenium RC test I have should simulate a user clicking on a button, implemented as a GWT PushButton (com.google.gwt.user.client.ui.PushButton). The problem is that the click on the button never seemed to work using the following code
selenium.click(BUTTON_ID);
A GWT PushButton is not a standard HTML <input type="submit" ...> or a
<button ...> rather it is a styled button constructed from DIV and other
HTML tags.
After some head scratching and experimentation it turns out that the click can be actioned using the following code.
selenium.mouseOver(BUTTON_ID); selenium.mouseDown(BUTTON_ID); selenium.mouseUp(BUTTON_ID);
Not exactly rocket science in the end, but it took a while to work out. Hopefully this will save someone else having to work it out from scratch.

Hello, I made some experiments.
IE6 and GWT 1.4.? : The 'mouseOver/mouseDown/mouseUp' method works perfectly.
IE7 and GWT 1.5.3 : The 'mouseOver/mouseDown/mouseUp' method does NOT work at all. But it will work again with this:
selenium.focus(pLocator);
selenium.keyPress(pLocator, "r");
Hope this can help.
protected void click(String locator) {
if (locator.endsWith("PushButton")) {
// Special case for cool buttons
if (isTargetFirefox()) {
// Work OK in FF 3.5.
String imageLocator = "//div[@id='" + locator + "']/img";
selenium.mouseOver(imageLocator);
selenium.mouseDown(imageLocator);
selenium.mouseUp(imageLocator);
} else {
// Work OK in IE7
String imageLocator = "//div[@id='" + locator + "'][1][1]";
selenium.focus(imageLocator);
selenium.keyPressNative(Integer.toString(KeyEvent.VK_SPACE));
}
} else {
selenium.click(locator);
}
}

