views:

233

answers:

2

I'm writing some automated acceptance tests for a flash movie (driving the movie using iMacros).

I need to "reset" the test environment before each test run by clearing out the settings flash is storing in Local Shared Objects.

I can do this manually by deleting the files in:

C:\Documents and Settings{username}\Application Data\Macromedia\Flash Player#SharedObjects\FQSTGCV7\{site-url}

Obviously I want to automate this deletion step; but I'm wondering how to determine the above path in a non machine specific way.

In .NET,

"C:\Documents and Settings{username}\Application Data\Macromedia\Flash Player#SharedObjects\" is clearly

    Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                                         @"Macromedia\Flash Player\#SharedObjects")

How do I figure out what "FQSTGCV7" will be on a different machine? Is there an environment variable? Is there only ever 1 directory below #SharedObjects\ ?

Thanks

A: 

I'm not sure how that series of characters are determined, however the fact that it always ends with the site-url leads me to believe a simple bit of regex/string matching should be able to do the job for you. Just look for a file that ends in your site's URL.

In addition, it is possible to make a Flash movie flush it's own data by simply pushing empty data to the LSO. Also, by going into the settings menu of the Flash player you can flush all of the data by dialing the desired amount of space for LSOs down to 0, closing the settings, and then re-opening settings and dialing it back up to the default 100k. Neither of these may be applicable in your case, but they do come in handy.

Branden Hall
Good point - I can just recursively search within all folders below #SharedObjects\ and delete all folders refering to my site's url
David Laing
A: 

Seeking to find the answer to the same question: "How do I figure out what "FQSTGCV7" will be on a different machine"?

Note: If you wipe out that folder and reboot it appears to generate a new "random code".

I am referring to it as the FlashRuntime key.

Any insight on to figuring out this value would be appreciated.

I checked the registry and couldn't find it there.

Worst case, I might create an LSO in realtime, and see what it was written to.

sobelito