Hi,
You'll be pleased to hear that webdriver works very well with AJAX
apps --- indeed, we're working closely with the GWT team to ensure
that GWT apps are easy to test with webdriver. There's a few things
that you can do that make testing these apps easier.
Firstly, put IDs or names on key elements in your interface for easy
location. Secondly, it's wise to build abstractions around common
components in the UI. For example, if you're dealing with a
SmartClient "button" class often, it would make sense to model that in
your code; this way, if the DOM structure changes, it should be a
quick fix to get things up and running again. Thirdly, if SmartClient
offers a Javascript mechanism for locating and interacting with
elements, you may be able to use that. The JavascriptExecutor can
return WebElements, and calls to "executeScript" can accept
WebElements as arguments.
That last point may need a little explanation. I'm not familiar with
SmartClient, but let's imagine that they offer a "Find" function in JS
to locate elements somehow. Your button code could therefore look
something like this:
public class Button {
WebDriver driver;
WebElement element;
public Button(WebDriver driver, String locator) {
this.driver = driver;
element = ((JavascriptExecutor) driver)
.executeScript("return Find(arguments[0]);",
locator));
}
public void click() {
((JavascriptExecutor) driver).executeScript(
"arguments[0].click;", element);
}
}
Finally, if you've got any information about the "detailed
architecture that would allow any Ajax framework that treats the DOM
as internal information to work with Selenium" mentioned in that
thread, I'd be keen to have a look a look at it --- I'm not aware of
it, but it sounds interesting.
Regards,
Simon