Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Creating Tests with Visual Studio

Micro Focus Expert
Micro Focus Expert
0 0 1,454

If you are a long-term Silk Performer user, you probably know that Silk Performer has been offering a Visual Studio and .NET support for many years. You used to install the so-called Silk Performer Visual Studio .Net add-on to make use of that support. Now, with Silk Performer 18.5, the capabilities of this add-on, which is now called a Visual Studio extension, have been considerably extended and enhanced.

It's now possible to use Visual Studio for the entire script creation and modification process. This is particularly useful, since Visual Studio offers a rich development and debugging feature set and a powerful editor. Silk Performer, on the other hand, offers extensive load and performance testing capabilities. So, once you are done with creating your script in Visual Studio and adapting it according to your needs, you can export it to Silk Performer to fully model your load test, execute it, and finally analyze the detailed results. And that is exactly what we're about to show you in this blog post: how to make use of the best of two worlds.

Creating Tests with Visual Studio - Blog graphic 1.png

Installing the extension

Before you can use Visual Studio to create your Silk Performer load test scripts, you have to install an extension: the Silk Performer Visual Studio extension. This is a fairly simple process: Open a file browser and navigate to your Silk Performer installation directory. Then open the folders Template and DotNet. So, your path should look similar to this one: C:\Program Files (x86)\Silk\Silk Performer 18.5\Templates\DotNet.

This folder holds a single file, named SpVsExtension.vsix, which is an extension installer file for Visual Studio. Double-click it an follow the installation instructions. Within a few moments, the extension should be installed and we can start using Visual Studio in conjunction with Silk Performer.

The workflow

Below you can see the workflow that we're going to follow in this blog post. First, we'll record a load test script by starting the Silk Performer Recorder directly from within Visual Studio. In step two, we'll learn that Silk Performer now can generate C# scripts from the recording, and we'll modify this C# script using Visual Studio's editor. In step three, we're going to start a trial run and use the Visual Studio debugging features to make sure that the script works fine.

Up to this point, everything we do happens within Visual Studio. We do not have to switch between applications or hop over to Silk Performer. Only at this point, when we're done with the whole script creation and modification process, we will export the script to Silk Performer, which is step four in our workflow. Then we can use the Silk Performer Workbench to model our load test - just as we're used to - by specifying a workload, configuring agents, and so on.

Creating Tests with Visual Studio - Blog graphic 2.png

Recording a script

We've already installed the Silk Performer Visual Studio extension, so we can now launch Visual Studio. We create a new project using the Silk Performer template. When we click OK, the Model Script dialog displays. This means that we can now start a recording directly from within Visual Studio. The extension supports web protocol and web browser-driven recording.

In our example, we record the Borland demo website (1) using Internet Explorer (2) and the resolution of an iPhone X (3) in landscape orientation (4). We can now record the script just as we're used to from the Silk Performer Workbench. Once we're done, we stop the recording and save the script. Now we can see another new feature of Silk Performer 18.5 and the new extension: The Capture File page displays within Visual Studio. We can make use of all the tools the Capture File page provides, like applying filters or adding recording rules.

Creating Tests with Visual Studio - Screenshot 01.png

When we click Generate Script, the extension does not create a BDL script, as you might expect, but a C# script. Also, the script displays in Visual Studio's editor, which means that we now have access to the full script development and debugging feature set of Visual Studio.

Modifying the C# script

The Visual Studio editor provides a lot of massively useful features for script editing, like zooming, collapsing, syntax highlighting, or IntelliSense. This makes it easier than ever to modify your script and adapt it to your needs. But we can also make use of other Visual Studio features like adding references. In our example, we extend the script by adding a reference to a web service (1). To verify that the web service actually returns results, we print them to the VU Output window (2).

Creating Tests with Visual Studio - Screenshot 02.png

Executing a trial run and debugging

On this occasion, we can also make use of the debugging tools. So, we set a breakpoint (1) and then click Silk Performer 18.5 > Run > Try Script with Debug (2). During the trial run, we can see in the Silk Performer VU Output window that the web service returns a table with cities, so everything works fine and we can stop debugging mode.

Creating Tests with Visual Studio - Screenshot 03.png

We further extend the script by adding a TrueLogInfo() function (1), which will show the results also in TrueLog Explorer. This time we click Silk Performer 18.5 > Run > Try Script to start a normal trial run. Once the execution is finished, we activate TrueLog Explorer and click the TrueLogInfo node, which we have named GetCitiesByCountry (2), in the tree to show the results in an XML table (3).

Creating Tests with Visual Studio - Screenshot 04.png

Exporting the script

Once we're happy with the way our script works, it's time to export it to the Silk Performer Workbench. We click Silk Performer 18.5 > Open in Silk Performer 18.5. The Visual Studio project automatically closes and the Silk Performer Workbench opens. When we expand the Scripts node in Silk Performer, we can see that the project contains a .bdf script. This script stub is used to link to the C# script. We can now use the full set of Silk Performer tools to model our load test and finally execute it.


If you already use both Visual Studio and Silk Performer on a regular basis, you will surely enjoy the new possibilities that Silk Performer 18.5 provides. Just make sure to install the extension, as it is not automatically installed with Silk Performer.

Watch the Creating Tests with Visual Studio video

In the following video, you can watch how we performed the above described steps:

More information

To learn more about all new features and enhancements Silk Performer 18.5 provides, take a look at the following blog post:

The Silk Performer Help is another comprehensive source of information.

If this article was useful for you, leave us a comment or like it. We appreciate your feedback.

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.