Tuesday, 24 March 2009

Testing Flash With Selenium

The company I work for has a large amount of Flash content on their website. This had made testing of the application very difficult as the Flash parts range from small components in the navigation to complex applications within applications. Fortunately we have been able to reduce some of the manual testing on this with the use of the Flash Selenium project from Google. This is essentially a wrapper for making JavaScript calls into the Flash movies using the External Interface. It handles the format of these calls which differ across browsers.

To start using Flash Selenium first of all the Flash developer must expose the relevant functions via the external interface. The the test developer references the Flash Selenium project from their test project and instantiates a FlashSeleniun object in their test with the Id of the embed tag. Now functions can be accessed in the flash externally using fs.call("FlashFuntionName", StringArrayParameters). Where fs is the FlashSeleniun object.

As you can see we can now verify all sorts of things such as that Flash objects have fully loaded onto the page or inspect properties before and after other function calls to check results. It also means we can check some basic funtionality on different player versions with selenium grid and some remote controls on appropriately configured environments.

This isn't by any stretch of the imagination an answer to the problems flash testing brings but it does help reduce the costs of manual testing.

No comments:

Post a Comment