The trend to more frequent and shorter release cycles in the software industry also results in tighter time frames for all your testing efforts (see the diagram below). One way to save time and make use of synergies is to reuse your existing functional tests for load testing. In this blog post, we'll show you how you can do just that, by using Silk Performer 18.0 and Silk Test 18.0. We will demonstrate how to export a Silk Test keyword-driven test to Silk Performer and how to execute it as a load test.
Synergies and advantages
Reusing functional tests can save you a lot of time, since you are getting rid of the scripting work that you would normally have to do within Silk Performer. Besides the obvious time savings advantage, reusing functional tests offers two more major benefits: (1) Silk Test users can now easily enter the world of load testing, and (2) Silk Performer users can make use of Silk Test's browser support for Firefox, Chrome and PhantomJS.
Starting with a Silk4J script
For this blog post, we're using a Silk4J keyword-driven test. We've already been using this script a while for functional testing, now we want to use it for load testing as well. We start by opening the Silk4J test script in Eclipse (1). In the screenshot below, you can see the keywords of this keyword-driven test (2). Also, we've created a globalvariables.properties file and defined two parameters: user and password (3). These parameters are serving as input to the Login keyword. We'll be making use of them also within Silk Performer in a moment.
Exporting the script as performance test
Now we click the Silk Test icon in the toolbar and select Export as Performance Tests. Silk Performer launches and an import dialog displays. Here we can select the tests we want to import (1) and we have a number of import options available: We select Script parameters as values from CSV file (2) and Random (3). This ensures that the parameters we've defined in the .properties file will be written into a .csv file, which will be referenced in the script. The values from within the .csv file will be selected randomly once the test is being executed. Finally, we select Firefox as the web browser for the execution (4) and click OK (5).
Analyzing the BDL script
Silk Performer now creates and displays a script, which can be considered a script stub, since it mainly consists of a few references to other files. We can find the BDL function SilkKDTExecuteTest() (2) which references the file library.zip with the Silk Test files in it. Furthermore, we can find the FileCSVLoadGlobal() function (1), which is the reference to the .csv file Silk Performer created during the import. We can find the two files also under the Data Files node (3). When we open the .csv file, we can see the two parameters (user and password), which we originally defined in the .properties file in Silk Test. If required, we could add some more data sets to this table.
Using the functional test for load testing
Now, let's start a trial run to verify that the imported script works properly. Firefox starts and the script is being executed. In our case, the Try Script Summary page shows that no errors occurred, so we can move on in the process of modeling our load test by stepping through the Workflow bar. We configure to run an increasing load test with 3 virtual users. When we start the load test, three instances of Firefox launch. We can actually see how the script is executed within the three browser windows in parallel.
Tweaking the settings
Of course you can also use different browsers in parallel for execution: Click Settings > Active Profile > GUI-Level Testing and the Execution tab and change the Browser type. Also you can create additional profiles and apply different profile settings for each, including the browser type.
In this blog post, we showed you how to import a Silk4J test to Silk Performer. But of course you can also import Silk4Net or Silk Test Classic scripts. Whether you're a Silk Test or Silk Performer user: Make sure to try out the new export feature to unleash the full potential of a combined functional and load testing strategy with Silk.
Watch the Functional Tests for Load Testing video
In the following video, you can watch how we performed the above described steps:
To learn more about all new features and enhancements Silk Performer 18.0 provides, take a look at the following blog posts:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.