Sep 08
25
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.
