views:

380

answers:

3

I guess I don't need the web browser, since network capabilities are built into the stand-alone player. I just need some kind of .NET component which will allow me to programatically start hundreds of flash players (with no UI) playing a specific SWF file for load testing purposes. The SWF file accesses a network service and downloads other SWF files, but basically runs on its own to completion once loaded into the player.

It would be nice if such a component would also allow me to detect when it is no longer accessing the network for a period of time or receive a message indicating that the SWF has finished its work, at which point I would terminate that instance of the flash player and start up a new one.

Perhaps I could use the existing flash player, but I don't want to actually start a player with a UI, I basically need to program a player with no UI, because if I'm going to be running hundreds of them on one machine, I don't need the overhead of actually rendering all the graphics. I will probably have this running on multiple machines as a distributed application.

Any thoughts?

+2  A: 

All the server cares about is the sequence of requests, that's what you want to simulate.

If the SWF uses HTTP for its content requests, JMeter or siege would be some free tools that help with that. Otherwise there are many commercial load testing tools. I can tell you the one that my company uses costs "lots", but I tend to use JMeter or siege when I do my testing before handing off to QA.

If you are testing streaming media, that becomes a bit more complex and you will probably have to validate your system as individual components.

I suggest the Allspaw book to anyone trying to do load testing.

http://my.safaribooksonline.com/9780596518578

caskey
No, actually the server cares about a lot more than the sequence of the requests... it cares about the content and timing of each request, because its involved in a complex communication protocol with the flash player.In other words, this cannot be simulated with a static script of HTTP requests (that would be easy). It requires dynamic communication from the actionscript-based application in the flash movie, so I actually need to simulate a bunch of running flash players with network access, minus the UI.
Triynko
I need to simulate users opening a browser, navigating to a flash movie, and letting the flash plugin run the movie for a good 5 minutes so it has time to finish all its communications before the browser is closed. If I could simulate just the plugin, or a standalone player, that would be even better. The flash movie does stream media, logs loading times, and reports everything it did when finished.
Triynko
I think you misunderstand. Tools like JMeter allow you to incorporate the timing and flow of the user into your test plan.
caskey
@Triynko, listen to Ditto. Any decent tools lets you put modify / play with the timing of requests for your load test.
Chris Lively
But do they actually simulating things like running a flash plugin for a while? Or do they just download the swf file and let it sit there, thinking everything has been downloaded and the simulation is over?
Triynko
http://jakarta.apache.org/jmeter/ "JMeter is not a browser." "JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages." If it doesn't even execute javascipt, it probably doesn't load a flash movie into a flash player plugin and support all the http traffic coming from the player, so that's definitely not what I'm looking for. I could write that myself in .NET.
Triynko
*sigh* Yes, JMeter is not a browser, however the browser is just a source of URL requests. You don't just point jmeter at the web page and magic happens, you use the jmeter proxy to record all the traffic between the browser and the web server. You then edit the output and turn that into a test suite that re-runs that traffic against your server according to your desires.If you want a short answer: NO you can NOT do what you want to do the way you are trying to do it. YES you CAN achieve what you want using tools that are readily available. None of it is a point and click solution.
caskey
My two cents - if the underlying Flash component does a bunch of logic that affects the network protocol traffic AND that logic is hard to reproduce with JMeter, then there is definitely a challenge. If it's trivial stuff, definitely use JMeter. If it's not (see http://ajaxian.com/archives/why-load-testing-ajax-is-hard for more info on this topic) then you might need something else.
Patrick Lightbody
@caskey, The browser is NOT just a source of URL requests (maybe in 1990's?); today, it's running client-side ActionScript code in a flash plugin with a complex communication protocol, resulting in dynamic traffic patterns which may never be the same from one session to the next. Testing requires either a real browser with the flash plugin (the easy, accurate, point-and-click solution), or it requires me to basically re-write the entire flash application in some scripting language compatible with JMeter (no way that's happening). I'm currently using BrowserMob, since it runs real browsers.
Triynko
@Triynko Sorry, but no matter what is going on, the web server never sees anything other than a series of HTTP requests. Whether they are generated by a web browser, flash app, javascript, or whatever, the server doesn't care. Functional testing may require the use of the flash app, but for load testing, the server doesn't care what's making the request.
caskey
A: 

If you're convinced that nothing will work except running the flash movie, grab one of the scripts for generating browser-based screenshots like Thummer. These will load the page you give it in either Firefox or Safari, and you can tweak them to loop like crazy and allow the flash movie to run.

A UI testing tool like selenium for firefox may also work to let you script what you want to do and fire off an automated sequence.

I also agree with Ditto -- JMeter will not only simulate the requests, but give you some usable metrics when you're done. If you do it yourself with a bunch of browsers, how will you know where the bottlenecks are?

Amot
A: 

If you need real browsers (which all have Flash 10 installed), check out my company, BrowserMob. It effectively does "Selenium load testing". A lot of our customers do Flash automation using our service and it is a LOT easier than traditional protocol-level load testing.

Patrick Lightbody
We talked on the phone yesterday (remember James and Jonathan?). For web-apps like mine with complex client-activity involving Flash ActionScript or AJAX, real browsers + cloud computing = accurate, easy load testing. BrowserMob is just what we needed, and I'm glad you created it.
Triynko
Originally, I was using the .NET command Process.Start( @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe", "my testing url") to launch one hundred tabs on my quad-core desktop. Those tests completed fine within a few seconds of each other and timing results were logged to the server by the automated flash clients, but I'm reluctant to open 5000 tabs on this one machine, even with 8GB of RAM. BrowserMob will allow me to do something similar using many more processing cores, but with many statistics available and even browser screenshots when errors occur.
Triynko