Re: [webdriver] Flash

Skip to first unread message
Message has been deleted

Jason Huggins

Aug 4, 2009, 7:29:48 PM8/4/09
On Tue, Aug 4, 2009 at 10:45 AM, PerfectStorm<> wrote:
> Has anyone tried to do any testing with Flash? Sorry for so mnay
> questions just trying to get a proposal together on automation tools
> we may use.

I have not, but*, that won't stop me from giving you advice on how to do it. ;-)

There are two approaches, one easy+bad, the other hard+good.

The easy+bad way:
First, you use webdriver to open the browser and load the page that
contains your flash app.
Second, you maximize the browser window so the flash application is in
a precise predictable location on the screen.
Third, you use something like Java's Robot library to send an OS-level
clicking and typing to an absolute screen coordinate that lines up
with the fields and buttons in your flash app.
This is bad approach because testing using absolute screen coordinates
is very, very brittle, but sometimes it's better than nothing. You
might be able to improve this technique by using absolute screen
coordinates *relative* to the top/left corner of the browser window,
whereever it happens to be on the screen. But it's still a risky move.
Test automation depending solely on screen coordinates was how it was
done in the Dark Ages. It is an uncivilized and barbaric practice that
should only be seen in museums.

The hard+good way:
First, you modify the source code of you the flash application,
exposing internal methods using the ActionScript's ExternalInterface
API. Once exposed, these methods will be callable by JavaScript in the
Second, now that JavaScript can call internal methods in your flash
app, you use WebDriver to make a JavaScript call in the web page,
which will then call into your flash app.
This technique is explained further in the docs of the flash-selenium
project. (, but the idea
behind the technique applies just as well to WebDriver.

Basically, there is no free lunch when it comes to testing a flash app
inside the browser. You either have to do it the bad old way using
brittle absolute screen coordinates, or you have to extend/modify your
flash application with custom automation methods. This is not a
possible solution if you don't have full control over the flash app's
source code. But if you do have full control, using the
ExternalInterface API is the preferred way to go.

- Jason Huggins
twitter: @jhuggins

Pushpraj Singh

Jul 11, 2013, 7:54:29 AM7/11/13

I think , I have got the right post to get the help.
I have already posted query here but no answer yet and since then I have read many forums and post related to this problem about uploading/browsing file via webdriver
This method sendKeys("absolute path to the file you want to upload via webdriver"); worked for me everywhere but
how to make this work when its a flash button.

You might not want to give answer to my problem because of two reasons:
a) I have already posted it on another forum and asking here too (duplicate)
b) might want to create another post as this post doesn't talk about any one problem but WebDriver Flash
So get to the post (if you insist otherwise I'll be happy if solve the problem), are you talking about using jars available on this page specifically
what are things that I can get out this jar, how to inculde this in my maven project.

Reply all
Reply to author
0 new messages