Enable testing of web applications created with help of Microsoft Silverlight


Silverlight applications use a special MSBin1 binary format to pass data between the client and server. These data structures are embedded into regular HTTP requests, so WAPT and WAPT Pro can record and replay such tests. However the original product cannot modify the content of the passed structures to create data-driven tests. This problem is resolved by a special Module for Silverlight testing. It can be installed on the system where you run WAPT or the workplace component of WAPT Pro.

The module automatically integrates with the product and enables it to display Silverlight binary data on the request properties and response processing tabs. Since such messages contain hierarchic data structures, WAPT represents them by XML documents. You can insert dynamic values to such documents to parameterize virtual user profiles and make WAPT use different data for each user session in the test.

You can also process server responses in MSBin1 format using XPath function, because WAPT translates the body of such responses to XML documents automatically with help of the Silverlight module. You can extract any data from the server output and insert it to the subsequent requests performing all the required parameterization.

You can use logs to browse the results of execution of a profile containing Silverlight data. Both the request and server response are shown as XML documents. A special difference viewer will let you easily compare the content of the current message with the originally recorded one.

Download

Parameterization of Silverlight requests in action

The following example demonstrates how you can parameterize data in HTTP requests sent by a Silverlight application. When the module is installed, all MSBin1 messages are shown in XML format. In this application the MessageID parameter is session-specific.

MessageID parameter is session-specific

The value we need to use is received from the server in the response to the previous request. It can be extracted with help of the XPath function and assigned to a variable.

Extracted with XPath function

In all subsequent requests we replace the originally recorded value of MessageID with the variable:

MessageID replaced with the variable

We can check the verification log and compare response with the originally recorded one. Log viewer also creates XML representation for this data.

Log viewer creates XML representation

The variable is assigned a value received in the verification session.

Verification session

In some cases you need to use the default namespace to specify proper argument for the XPath function. There is a special namespace prefix called DEFNS. In the following example the CompanyID value is extracted with help of that namespace specification:

Extracted with help of namespace specification

Without the module the MSBin1 messages are not recognized and it is not possible to parameterize them. Such requests will be sent to the site as usual; however they will contain outdated values. In most cases this will lead to the application errors. Since XML representation is not available without the module, those binary messages will be unreadable as shown below.

Unreadable MSBin1 messages

If you see a similar to the above response in your profile, we recommend installing the Module for Silverlight testing.