In this blog post, we will learn about AMF Protocol, AMF Terms, sample script and recording mode of AMF Protocol in HP LoadRunner.
HTTP is the preferred method of communication between client and server. For the secure way of communication, SOAP (Simple Object Access Protocol) over HTTP, an XML based format is useful. But the limitation of SOAP over HTTP is: it cannot transfer large files such as Rich Internet Applications, Flash files etc.
Hence Macromedia created proprietary protocol called Action Message Format (AMF) protocol which communicates over HTTP in binary format. This binary AMF data is smaller than SOAP’s XML.
Client application (computer, mobiles, tablets etc) submits AMF messages over HTTP to the application server. Flash players from the client application sends native Flash objects to an application server via a gateway called Flash Remoting Gateway which is a server-side object (which is installed either in Java (ColdFusion) or in .NET).
This gateway acts as an intermediator that handles request between client and the server. It translates the objects and serves the appropriate services.
Once the requests processed, the gateway serializes back into native Flash objects and send them to the client application.
Action Script – a scripting programming language (similar to Javascript) is used to control Flash movies and application.
Below is the sample AMF script:
amf_define_header_set("Id=amf_header_set", Â Â Â HEADER, Â Â Â "Name=amf_server_debug", Â Â Â "MustUnderstand=true", Â Â Â "Data=<object><boolean key=\"coldfusion\">true</boolean> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <boolean key=\""Â Â Â "amfheaders\">false</boolean>... Â Â Â LAST); amf_call("flashgateway.samples.FlashJavaBean.testDocument", Â Â Â "Gateway=http://testlab:8200/flashservices/gateway", Â Â Â "AMFHeaderSetId=amf_header_set", Â Â Â "Snapshot=t3.inf", Â Â Â MESSAGE, Â Â Â "Method=flashgateway.samples.FlashJavaBean.testDocument", Â Â Â "TargetObjectId=/1", Â Â Â BEGIN_ARGUMENTS, Â Â Â "<xmlString><![CDATA[<TEST message=\"test\"><INSIDETEST Â Â Â Â Â Â Â /></TEST>]]></" Â Â Â "xmlString>", Â Â Â END_ARGUMENTS, Â Â Â LAST);
Table of Contents
Recording Settings for AMF Protocol
You can use following protocol combinations to record:
- AMF Only
- Web Only
- AMF and Web
Commons Issues you face in AMF protocol
When you record Flex applications using AMF protocol, sometimes VuGen might not be able to decode externalizable objects. To overcome this issue, go to Recording Options, click on Code Generation under AMF Protocol and check Encode externalizable object with LoadRunner parser as shown below and then click on OK.
VuGen generates Custom Request functions containing unparsed AMF3 binary data.
Hi do you know how to performance test the AMF applications in Jmeter?