How to use JMeter to load test Flex applications
Flex applications use a binary protocol called AMF. The easiest way to use JMeter with a Flex application is to use Charles (the indispensable 100% pure Java cross platform http debugging proxy). Here are the steps:
- Start Charles and visit the site whose Flex application you wish to load test. In Charles, you will see the entire HTTP traffic.
- Click on the Charles’s Sequence panel to see the ordered list of HTTP requests.
- Right click (on Mac control click) and save the HTTP request corresponding to a Flex AMF call to a file.
- On JMeter create a new HTTP sampler for this request. Set the Send a File with Request to the file that you saved on the step before. Set the MIME Type to application/x-amp (click here to see the JMeter screen)
That is really it. Just save the request using Charles, and then reference it in the JMeter HTTP Sampler. Couldn’t get much easier than this. The solution gets a bit more complicated if you need to read the requests and extract data for use in subsequent requests. To do this, you’ll have to write some code. I’ll add an entry on how to do this soon.
May 26, 2008 at 6:20 pm
Hello, it seems to be nice, but looks that Charles is commercial. Do you have any other suggestions with open source tools?
Thanks.
May 27, 2008 at 2:44 pm
Hello, it seems is possible to record AMF request with JMeter(https://issues.apache.org/bugzilla/show_bug.cgi?id=39641), but I could not make it work. Any ideas?
Thanks.
June 1, 2008 at 1:47 am
Hi Bruno, The Charles HTTP debugging proxy is worth every cent of its cost. If you need to monitor HTTP traffic and view AMF messages then it may be your only choice. It is cross platform. On Windows there is Fiddler which I think is free but I’m not sure if it can parse AMF message.
I’ve not used the HTTP proxy that comes with JMeter. Simply recording AMF has its limitations, however, it works for simple workflows that do not need any user input, but if you need to modify the requests based on the responses, then you will need to write a Java Sampler that can read/write AMF messages. I’ve started doing just that, but other projects are keeping me too busy at this point.