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.
July 21, 2008 at 6:38 am |
thanks for the post!
it provides novice like me a good ref on how to use charlesproxy to record AMF request.
may i know when will you be writing the subsequent article on how to read the requests and extract data for use in subsequent requests?
January 27, 2009 at 2:18 am |
[...] to load test your application via replaying this AMF request. To do that, you can look at this article for detail. However, Charles is a commerical product. If you want a free solution, you can try [...]
March 2, 2009 at 8:07 pm |
It isn’t the same thing, but you can use HTTPFox (an extension for FF) for record HTTP requests and then debug you AMF.
An obs: the AMF mime-type is application/x-amf, not application/x-amp
July 29, 2009 at 4:39 pm |
hi all
I’ve tried to load test a flex app. Actually, JMeter can record the scenario but when playing back the stuff : i have 100% errors on my swf :’(
do you know whether JMeter has problems handling flex app components ? or some kind of Session problems whithin Flex perhaps ?
thx
November 16, 2009 at 8:07 am |
With current version of JMeter you can use the built-in HTTP Proxy Server to record the requests and load the tests.
December 17, 2009 at 7:23 pm |
I can record with Jmeter(it saves .binary files for each request) and playback no problem. But if I’m going to do real load testing then I need to vary each request with slightly different data. Any ideas on how to modify/parameterize the .binary file or any other solution?
Thanks,
Peter
January 18, 2010 at 1:25 pm |
I am facing the same problem, which is mentioned by Peter above.
If anybody has the solution, please help!
Thanks
Rachit
May 3, 2010 at 5:04 pm |
I discovered a very interesting free alternative to Charles Proxy : TcpCatcher (http://www.tcpcatcher.org)
cheers
Chris
August 18, 2010 at 3:46 am |
Hey Chris, tcpcatcher is a great tool.
is there any ways to post data using jmeter ?
August 20, 2010 at 3:03 am |
I met the same problem which is mentioned by Peter above, any solution?
Shahram, please help me.
Thanks
Kathy
September 15, 2010 at 1:50 pm |
JMeter plugin visualizer for deserialize response in text.
http://code.google.com/p/jmeter-amf-visualizer
September 20, 2010 at 11:05 pm |
Hi Racsor,
I want to know more about this plugin and how Jmeter is implemented with it.
September 21, 2010 at 3:53 pm |
Hi Racsor,
We are using your plugin we need you help with that because we put it on BIN but we don’t how to use on Jmeter . Can you help me with this?, my email is Gilbertofp16@gmail.com
December 14, 2010 at 8:23 pm |
@Gilberto
When you add his plugin you will see an AMF choice in the dropdown when you add a “View Results Tree”.
February 10, 2011 at 5:52 am |
sir,
Is it possible to load test a Desktop application with this way.My software having Audio and Video module so please give a reply to my desktop application
September 25, 2011 at 1:31 pm |
In case it helps anyone who happens across this article, there is now a JMeter plugin that lets you record and edit AMF messages for use in load testing. You can even use this tool to test apps that have unique session ids embedded in the AMF.
https://github.com/steeltomato/jmeter-amf
Ken (Project Maintainer)
October 6, 2011 at 7:59 am |
Hi, very nice post. Very usefull