Data Format Extensions (DFEs) - Overview

Data Format Extension (DFE) support enables easier scripting of web applications by providing the ability to decode and encode formatted data that is exchanged between the client and the server. This enables easier correlation and parameterization of the generated Vuser scripts.

Applies to:

  • Web - HTTP/HTML Vuser scripts

  • Web - HTTP/HTML steps inside Flex Vuser scripts

When to use DFEs

When you record a Vuser script, VuGen records the HTTP requests and responses that are passed between the client and 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.

LoadRunner uses data format extensions (DFEs) to resolve the difficulties that arise from encoded data in Vuser scripts. DFE support allows easier creation of Vuser scripts by providing the ability to decode the encoded data that is exchanged between the client and the server. By providing the decoded format of the data, the information is presented in the Vuser script in a readable format that enables you to correlate and parameterize the script as required. When the script is replayed, the DFE support re-encodes the modified Vuser script, and enables the Vuser to send the correctly encoded request to the server.

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.

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, see Data Format Extension List.

Back to top

How DFEs are applied

You enable DFE support for each Vuser script that requires decoding of encoded data. When DFE support is enabled, the DFE support is applied in the following circumstances:

  • Each time the script is generated (after recording) or regenerated. The DFEs are applied to decode the data to produce a script that is easy to understand and work with.

  • Each time the script is run. The DFEs are applied to re-encode the decoded data to produce HTTP messages with encoded data in a format that is expected by the server.

Note: In addition to applying DFEs when a script is generated or replayed, it is possible to apply a DFE to a selected string in a Vuser script. For details, see How DFEs Modify a Vuser Script.

In some scenarios, decoding of encoded data must be performed in a number of stages, until the fully decoded data is produced. Each stage in the conversion process is performed by applying a specified DFE. For example, encoded data from a response may be decoded by applying three DFEs - first DFE-1, then DFE-2, and then DFE-3. In each stage, the output from one DFE is the input to the next DFE, until the fully decoded data is produced.

Back to top

DFE chains

The series of DFEs that are required to decode encoded data is defined in a chain. For example, you could create a chain called DFE-Chain-1 that includes three DFEs: DFE-1, DFE-2, and DFE-3. The sequence of the DFEs inside a chain is significant—the sequence indicates the order in which the DFEs are applied to the encoded data.

If only a single DFE is required to decode encoded data, the DFE must still be included in a chain.

Assigning DFE chains

HTTP messages can be divided into a number of sections, including a body, headers, cookies, and a query string. After you define the DFE chains that will be applied to decode and encode a Vuser script, you must specify to which sections of the HTTP messages the DFE chains will apply. Because each HTTP message has only one Body section and one Query String section, you can specify only a single DFE chain to apply to each of these sections. In contrast, each HTTP message can contain numerous headers and cookies. Consequently, you can specify a particular DFE chain to apply to each header and cookie. For details, see Applying DFE Chains.

Back to top

Replaying Vuser scripts that contain DFEs

When you replay a Vuser script that contains DFE functionality, various messages are added to the Replay log in VuGen's Output pane. Make sure to check these messages to ensure that the DFE functionality is correctly implemented. For further details, see Troubleshooting - Data Format Extension (DFE) .

Back to top

Example of code generated with and without GWT-DFE support

Original Script - without GWT-DFE Support
6|0|11|http://localhost:8081/MyTestApp/testapp/|624C899BB846618A2E7F49092
8212946|com.test.client.GreetingService|greetServeCompAns|com.test.client.ComplexObject/198661839
|GWT User|inside object|java.util.HashSet/1594477813|java.lang.String/2004016611|add string1|
 string2|1|2|3|4|1|5|5|1001|1999|6|5|321|1234|7|0|8|0|8|2|9|10|9|11|

Script after applying GWT-DFE Support
<LR_EXTENSION name="GWT_DFE_1">
<com.hp.dfe.GWT__Request>
<moduleBaseURL>http://localhost:8081/MyTestApp/testapp/</moduleBaseURL>
<rpcRequest>
<flags>0</flags>
<method>
<class>com.test.client.GreetingService</class>
<name>greetServeCompAns</name>
<parameter-types>
<class>com.test.client.ComplexObject</class>
</parameter-types>
</method>
<parameters>
<com.test.client.ComplexObject>
<anIntField>1001</anIntField>
<anotherIntField>1999</anotherIntField>
<name>GWT User</name>
<objectInComposingField>
<anIntField>321</anIntField>
<anotherIntField>1234</anotherIntField>
<name>inside object</name>
<stringsSet/>
</objectInComposingField>
<stringsSet>
<string>add string2</string>
<string>add string1</string>
</stringsSet>
</com.test.client.ComplexObject>
</parameters>
<serializationPolicy class="com.google.gwt.user.server.rpc.impl.StandardSerializationPolicy"/>
</rpcRequest>
</com.hp.dfe.GWT__Request>
</LR_EXTENSION>

Back to top

See also: