In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you "Flex programs how to achieve performance testing", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "Flex programs how to achieve performance testing" this article.
Flex program performance testing
Flex of Adobe has become more and more popular, but there are no good tools for performance testing of Flex programs. Including the famous performance testing tool LoadRunner, there is no good support for the performance testing of the new version of Flex. In the research of practical work, the author found a good way to test Flex programs. This article focuses on how to handle AMF messages for Flex in performance testing. The testing tool used in this paper is TheGrinder, and the development languages are Jython and Java.
The Perplexity of 1.Flex Program performance testing
By default, Flex uses the AMF protocol for transmission. The interaction between the browser and the server side of the AMF protocol is transmitted through the HTTP protocol, as shown in figure 1-1. The Client side sends to the server side: first is the ActionScript object, wraps the AMFMessage,AMFMessage object and then serializes it into a binary array, stores it in the data domain of the HTTPPOST request, after the data is transmitted to the server, it is de-serialized into the Java version of the AMFMessage object, and then the server-side Flex framework takes out the business object in the AMFMessage and sends it to the corresponding server-side Java object. Server end to client side is similar.
Figure 1-Transport of 1FlexAMFMessage
When AMFMessage is recorded with a script recorder, it is a string of unreadable binary arrays.
Result=request1201.POST ('/ home/messagebroker/amfsecure'+)
'? RND'
(0x00pc0x03pr 0x00rec 0x00pl 0x00pr 0x00pl 0x01pr 0x00pl 0x00pr 0x04
0x6E,0x75,0x6C,0x6C,0x00,0x02,0x2F,0x31
0x00,0x00,0x00,0xCB,0x0A,0x00,0x00,0x00
0x01,0x11,0x0A,0x81,0x13,0x4D,0x66,0x6C
0x31,0x30,0x37,0x37,0x34,0x32,0x45,0x31
...
0x07rec 0x6e recorder 0x69rec 0x01rec 0x04j0x00,)
(NVPair ('Content-Type','application/x-amf'),))
If you do not need to do any parameterization of the sent AMFMessage, just play back the script. But if you want to understand the contents of the AMF message, or if you need to modify the contents of the AMF message according to the actual situation and then send it out, then you have to find a way to parse the binary array. As mentioned earlier, this binary array is actually the serialized data of the AMFMessage object. Unfortunately, this serialization algorithm is customized by Adobe, ordinary Java deserialization can not be parsed, and after parsing into AMFMessage objects, it needs to be re-serialized into binary and sent to the server. The author has tried a variety of methods to parse and code AMFMessage objects. * find a method that can well code and parse AMFMessage, and apply it in practical testing. This method is suitable for both TheGrinder and LoadRunner.
two。 Parse and encode FlexAMFMessage
First find the flex-messaging.jar and flex-messaging-common.jar packages in the deployed Flex application, usually in the war/WEB-INF/lib directory.
Open Eclipse to create a JavaObject reference to these two packages, and create a class AMFTransformer that is responsible for parsing and encoding AMFMessage.
Load the following objects:
Importflex.messaging.io.SerializationContext
Importflex.messaging.io.amf.ActionContext
Importflex.messaging.io.amf.ActionMessage
Importflex.messaging.io.amf.AmfMessageDeserializer
Importflex.messaging.io.amf.AmfMessageSerializer
Decode, binary to AMFMessage object, using AmfMessageDeserializer class:
After the AMFMessage is parsed into a Java object, you can make any changes according to your actual needs.
Encoding, AMFMessage objects to binary arrays, using the AmfMessageSerializer class:
Note: the constructor of AmfMessageSerializer,AmfMessageDeserializer varies slightly from version to version, and SerializationContext may be required as an argument to the constructor.
After the AMFMessage is parsed into an object, in order to make it easier for testers to read and understand, you can use the open source package XStream to dump the Java object into XML.
3.Flex performance test
Once the FlexAMFMessage message can be parsed and encoded, it can be tested using traditional Web performance testing tools.
The above is all the content of the article "how to achieve performance testing of Flex programs". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.