Venkat Matta

it's all about the Performance Testing

DFE

Data Format Extensions (DFEs) – Overview

Note:  DFE applies for  Web (HTTP/HTML) and Silverlight Vuser scripts, and to Web (HTTP/HTML) steps inside Flex Vuser scripts.

When you record a Vuser script, VuGen records the HTTP requests and responses that are passed between the client and the web server. The data in these HTTP requests and responses is often encoded. For example, some of the data may be in binary format. The encoded data may be in the HTTP query string, headers, body, or cookies. When the encoded data is included in a Vuser script, the resulting script will contain data that is difficult to decipher. This makes it difficult to identify text strings that can be used for parameterization and correlation.

The script segment below shows a section of a Vuser script that was generated while recording business processes on a GWT-based application. Notice how some sections of the script contain encoded data and are therefore difficult to decipher.

DFE_GWT_cryptic.png

LoadRunner includes a number of pre-defined DFEs. Each DFE is able to decode and encode a specific type of data. For example, the GWT DFE decodes GWT data to XML format when a script is generated, and it encodes XML-formatted data to GWT-formatted data before the script is replayed. For a full list of the pre-defined DFEs,

When a DFE is applied to a Vuser script and the script is then regenerated, the DFE modifies the script and replaces the encoded data with decoded data. For details on how the script is modified,

How DFEs Modify a Vuser Script

When a DFE is applied to a Vuser script and the script is then regenerated, the DFE causes various modifications to be made to the script, as follows:

  • VuGen replaces the original encoded text string with a parameter.
  • VuGen inserts a web_convert_from_formatted function before the function that contains the new parameter. The web_convert_from_formatted function contains the decoded value of the original encoded text.

The script section below shows a web_custom_request function that was generated without DFE support. The Body tag in the function includes a text string that is base64 encoded, Body=TW9uZGF5. Because the value of the Body tag is encoded, it is difficult to change its value if required for correlation or parameterization purposes.

DFE_modify_1.png

After applying Base64 DFE support, the value of the Body tag in the regenerated script is replaced with a parameter called DFE_PARAM, “Body={DFE_PARAM}, as shown below.

DFE_modify_2

In addition, the modified code also includes a web_convert_from_formatted function. The function indicates that the decoded value of the originally encoded string is Monday. It is now simple to change the value from Monday to any other day by simply changing the decoded value in the web_convert_from_formatted function.

Data Format Extension List

Data Format Extension
Description
Base64 Extension
Decodes strings that are encoded with a Base64 encoder.
Binary to XML Extension Transforms Microsoft WCF binary XML into XML format.
GWT Extension Transforms GWT data to XML format.
JSON to XML Extension
Transforms JSON data to XML format.
Prefix Postfix Extension
Enables you to cut data from the beginning and/or end of a string which you do not want decoded. You can add and customize as many prefix/postfix extensions as required. Each postfix/prefix extension created should have a unique display name and tag name.
Remedy to XML Extension Transforms Remedy request data into XML format.

Note that this extension does not transform Remedy response data – which is JavaScript code.

URL Encoding Extension
Decodes strings that are encoded with URL encoding format.
XML Extension
Receives data and checks to see if it conforms with XML syntax. This check allows VuGen to perform correlations based on XPath and to display snapshot data in an XML viewer.
XSS Extension Enables you to test sites that use Cross Site Scripting (XSS) defense code.

 

 

Leave a comment

Information

This entry was posted on March 31, 2016 by in Loadrunner.