Sunday, May 17, 2009

FlexUISelenium for testing Flex UI with Selenium

Due to the high number of requests for making FlashSelenium directly test the UI components of a Flex application, I got involved in a new open source project: flex-ui-selenium. The new component, FlexUISelenium, is used with Selenium RC for testing Flex UI interactions.

FlexUISelenium is an extension to the Selenium RC client driver that enables the Selenium RC client drivers to interact (and test) the Flex UI components and methods of the Flex application.

Here is a sample test code using FlexUISelenium:


@Test
public void sumForValidNumbers() {
flexUITester.type("2").at("arg1");
flexUITester.type("3").at("arg2");
flexUITester.click("submit");
assertEquals("5", flexUITester.readFrom("result"));
}


FlexUISelenium uses Selenium RC, Flash Selenium and Selenium Flex API. FlexUISelenium uses FlashSelenium for enabling the communication of Selenium RC client with the Flash application (swf). And Selenium Flex API exposes all the UI components of the Flex application which are built with SeleniumFlexAPI.swc.

The first public release has just been uploaded to the project page.

Enjoy it!