Fluffy bunny

July 21, 2008

Selenium RC and Flash

Filed under: Uncategorized — aaron @ 4:30 pm

I’ve been experimenting with Selenium RC and Flash. I thought I’d try the Automation API, but found this:

http://www.adobe.com/devnet/flash/articles/flash_selenium_04.html

Here is the download:

http://code.google.com/p/flash-selenium/

I included flash-selenium-java-client.jar into my eclipse project along with the selenium jars and junit 3.8 jar, and it ran out of the box, though I had trouble getting it to work with junit 4.  Probably cut and paste errors.  It lauches selenium (expects an existing server) and goes to a demo page and clicks on the colors.

http://www.geocities.com/paulocaroli/flash/colors.html
I don’t know the depth of the API, but it passes the sniff test.  One thing that doesn’t make sense is the inclusion of a SeleniumException library that is not used.  Maybe a pre selenium 1.0  artifact that should have been cleaned up.

The description on the google code site says:

“Selenium RC uses JavaScript to communicate with the browser. And Flash ExternalInterface provides a mechanism for which you can use JavaScript to call an ActionScript function in the Flash Player. Therefore we can use JavaScript as the conduit between Selenium RC and the Flash application”

It adds:

“You can invoke functions which were externalized by the ExternalInterface, as well as the default functions of any flash object (e.g, PercentLoaded(), IsPlaying(), etc). The following are code snapshots from the ColorsTest—the sample Seleniun based JUnit test.”

This doesn’t sound like the ideal way.  I’ll need to look more into Flex Automation API, but this looks like a quick and dirty solution to functional automation.  With the work of creating a Junit 4 base class and extending it with helper functions, it might be a framework that could be easy to use for more average testers.  I need to learn more about flash automation, and flash in general though.

2 Comments »

  1. Additional related links:

    http://wiki.openqa.org/display/SRC/Testing+Flash+with+Selenium+RC

    Comment by aaron — July 21, 2008 @ 5:03 pm

  2. http://wiki.openqa.org/display/SRC/Testing+Flash+with+Selenium+RC

    http://osflash.org/autotestflash

    http://www.adobe.com/devnet/flash/articles/flash_selenium.html

    Comment by aaron — July 21, 2008 @ 5:06 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress