Load Testing Apache and Adobe Flex with JMeter made easy

Datetime:2016-08-23 02:59:23          Topic: Adobe Flex  XML           Share

Context:

You want to load test a Adobe or Apache Flex application that uses AMF protocol to dialog with a BlazeDS Backend server (Majority of Flex applications do).

You would like to use your favorite Open Source Load Testing tool Apache JMeter for this, but unfortunately AMF protocol is binary making it impossible to:

  • Variabilize request
  • Extract data from responses

Failing to do this will make your test unrealistic and useless.

Hopefully Ubik Load Pack comes to the rescue.

Features:

Our plugin offers you all you need to easily do your load tests

Record

With its seamless integration with JMeter, you can record your application scenario as you would do for a regular HTTP website.

Just select File > Templates… > Recording, select “ HTTP(S) Test Script Recorder ” and click Start button:

AMF_RECORDING

Configure your browser to use JMeter proxy, in this case localhost on port 8888 and start navigating on your webapp.

When an AMF request is recorded a ULP_AMF Request will appear under Recording controller:

AMF_SAMPLER

As you see the AMF binary and unreadable request is automatically transformed to XML.

Make Test dynamic

To make our test realistic, we want to variabilize Paris in this example to extract it from a CSV where we will put a list of French Towns.

This is just as easy as replacing in the AMF Request Paris by ${town} and adding a standard CSV DataSet in our Test Plan.

Debug your script

To do this, just add a View Results Tree to you plan, hit play button and click on one AMF Request, select ULP_AMF to XML Viewer:

AMF_ULP_AMF-to_XML

This viewer shows Request and response as XML.

Or choose ULP_AMF+XPath Tester:

VRT_AMF_SAMPLER

As you see this View will let you:

  • See response as XML in the upper right panel
  • Input XPath expression in the middle panel
  • And see the result in the lower right panel

Once you have found the right XPath Expression go to next step and extract data.

Extract Data from Response

To extract XML, you will use ULP_AMF Post Processor.

This post processor exposes Flex Response as XML in a variable ( FLEX_RESPONSE in this example) )so that you can extract data from Flex responses and expose them as variables.You should use it whenever you must extract some data from a FLEX response.

It must be placed:

  • As a child of any FLEX Response you need to decode
  • Before any JMeter post-processor that must use the exposed variable (so that the variable exposed by ULP AMF PostProcessor is available to it

AMF_EXTRACTOR

You can then use any Standard JMeter Post Processor to extract data from it.

Let’s use XPath extractor to extract for example country id:

AMF_XPATH_EXTRACTOR

Notice extractor operates on the FLEX_RESPONSE Variable (upper right) we have extracted in previous ULP_AMF Post Processor .

And now you can use ${country_id} in the following requests.

ND;LR:

As you saw in this tutorial, with Ubik Load Pack you easily reuse all your JMeter skills and get all the toolset you need to make AMF/Flex Load Tests.

To summarize with our plugin you will get:

  • Recording with OOTB JMeter HTTP(S) Test Script Recorder
  • Script Debugging with OOTB View Results Tree and the 2 renderers provided by plugin
  • Variabilize your request with OOTB CSV DataSet thanks to the transformation or request to XML
  • Extract data from responses with any of JMeter Extractors (Regexp, XPath or CSS/Jquery)

So ask for a trial version and start playing with our plugin.

About us:

Ubik Load Pack is a JMeter based solution for complex protocols.

Follow us on Twitter and StackOverflow.

Follow Apache JMeter on Twitter

Follow JMeter-Plugins on Twitter





About List