NOTICE: Our Community is moving. Get more information. Updated information on a New Login Process
This article provides steps to setup Silk Test Workbench tests to generate a single html pass or fail result file with execution times for both Visual Tests or VB.NET scripts.The solution provided in this article is a VB.NET solution. By default the generated html result file is stored in "C:\ResultsFiles", if you wish to change the path to the result directory, you can do so in line 3 of CreateHTMLRes VB.NET script. In addition, the solution takes an additional argument of the Silk Test Workbench logged-in user, which you can specify in your test, if this information is not provided, then the domain user is used. You should not require any further modifications to the provided scripts unless you wish to add additional functionality to the solution.In order for the solution to function correctly, please ensure that you have disabled the Silk Test Workbench general playback option 'Catch Exceptions when Thrown' and set its value to 'No'. This option was introduced in Silk Test Workbench 13.0.Solution details:You will find attached to this article STWB_Res2HTML.zip. This archive contains the required VB.NET scripts to generate the HTML result file at the end of the test execution.The following VB.NET scripts are included: - Common.CreateHTMLRes - Common.GetStartTime - Common.Res2HTML - Common.CloseHTMLResBelow are the list of input / output variables of the above scripts: - Common.CreateHTMLRes Input variables: - script_name - user_name Output variables: - start_time - res_file - Common.GetStartTime Input variables: - none Output variables: - start_time - Common.Res2HTML Input variables: - start_time - script_name - last_error - res_file Output variables: - none - Common.CloseHTMLRes Input variables: - start_time - res_file Output variables: - noneThe article also provides an example project, STWB_Res2HTML_ProjectExample.zip, which provides templates on how to setup your existing Visual Tests or VB.NET scripts to use the solution.The following project template files are included: Visual Test Templates: - Res2HTML.Driver_VisualTest - Res2HTML.Test1_VT - Res2HTML.Test2_VT - Res2HTML.Standalone_VisualTest
Res2HTML.Driver_VisualTest example HTML result
VB.NET Script Templates: - Res2HTML.Driver_TestScript - Res2HTML.Test1_TS - Res2HTML.Test2_TS - Res2HTML.Standalone_Script
Res2HTML.Standalone_Script example HTML result
Below are the variable / parameter requirements for each script type.Visual Tests: Driver Visual Tests: 1) Must contain the local variables (of Text) - res_file - start_time Visual Tests to be called by the Driver Visual Test: 1) Must contain the parameter (of Text) - res_file 2) Must contain the local variables (of Text) - last_error - start_time Standalone Visual Test: 1) Must contain the local variables (of Text) - last_error - res_file - start_timeVB.NET Script:There is no requirement to create input or output parameters from the UI for the provided VB.NET script templates, but instead they have been created for you in the scripts. Therefore, review the script templates and follow the same structure in your scripts. Comments have been provided in the script templates to show where you should insert your scripts.Key Points:1) In order for the solution to function correctly, please ensure that you have disabled the Silk Test Workbench general playback option 'Catch Exceptions when Thrown' and set its value to 'No'. This option was introduced in Silk Test Workbench 13.0. This is to allow the ErrorHandler statements used in the example project templates to produce expected results.2) This solution also requires that you maintain the use of the ErrorHandler statements shown in the Visual Test and VB.NET script templates when creating your own tests. The ErrorHandler statements allow the solution to capture the error text to the HTML result. a) For a Visual Test, the error text is stored in the reserve variable st_LastError. Use the Expression designer to store the error text to the last_error local variable of the script. b) For a VB.NET script, the error text is stored in the description method of the ErrorHandler variable Err. You can retrieve the error text by calling Err.Description and storing this data to the last_error variable.
I am trying to import 0882.STWB_Res2HTML_ProjectExample.xml file, but keep on getting "No assets were retrieved from the specified media." Please reply
sumit04, that XML file is exported from 18.104.22.16849, are you using an earlier version of Silk Test? You can only import XML files that were generated from the current or previous versions of Silk Test.
eggbox, thanks for for your quick reply. I am having 22.214.171.12431 version of Silk Test. but still I am facing the issue.
I was browsing for the resolution and I found this:
Is this the only resolution?
The article refers to the situation where the XML file is corrupt and needs to be regenerated. I opened both these files and put them through an XML validator, both files are fine (syntactically correct). I also imported the files into the latest version of Silk Test (15.x) and they imported fine.
Can you open the files in something line IE, if this shows the file correctly then you know that there is something else going on with your machine. Also, have you tried exporting one of your own assets (Visual test or .Net script) and reimporting it (possibly to a new database) to see whether you can actually export/import correctly.
I'm looking for a solution to generate an HTML report for my Silk4j tests. DO you have any suggestion?