How do I make Silk Central Test Manager display correct result status from third party tests?

0 Likes

Problem:

How do I make Silk Central Test Manager display correct result status from third party tests?

Resolution:

When Silk Central Test Manager retrieves the results files from the working folder on the assigned execution server if reads the output.xml file automatically to ascertain the error count / warning count and other information. While the output.xml file is created automatically for SilkTest or Performer testcases we will need to create it ourselves for other test type such as WSH or Perl. The user must pass in the error or warning count etc as part of the scripts error-handling. Below (and attached) is the code that will need to be appended to your scripts for Silk Central Test Manager to detail the results correctly. The user will have to pass in the error counts and warning counts.

The output.xml file has to be in the following format

The Perl Script

#!c:\perl\bin\perl.exe use Fcntl;
#The Module sysopen (THERESULTS, "output.xml", O_RDWR|O_EXCL|O_CREAT, 0755);

#Create the output.xml file

$nooferror = 3;
$noofwarning = 4;
#output.xml must be in the correct format

printf THERESULTS "\n";
printf THERESULTS "\n";
printf THERESULTS "$nooferror\n";

#Number of error encountered in you"re the script
printf THERESULTS "$noofwarning\n";
#Number of warning encountered in you"re the script

printf THERESULTS "false\n";
printf THERESULTS "\n";
printf THERESULTS "some_message_text_\n";

#Message to appear in Results -> Messages

printf THERESULTS "Error\n";
#Message Severity printf THERESULTS "

\n";
printf THERESULTS "

\n"; close (THERESULTS);
sysopen (THEERRORS, "error.txt", O_RDWR|O_EXCL|O_CREAT, 0755);

#Create a Result.txt file. Here you can document errors that occurred

printf THEERRORS "Error - unable to open file\n";
printf THEERRORS "Error - Window is Not Found\n";
close (THEERRORS);

The information passed to Silk Central Test Manager is detailed here.

The Windows Scripting Host Script

WScript.Echo "starting"

Dim outFile
Dim errCnt
Dim noofwarning

outFile = "output.xml"
resultsOut = "results.txt"
errCnt = 1

" retrieve that from your test results

noofwarning = 2 Set FSO = CreateObject("Scripting.FileSystemObject")
Set oTX = FSO.OpenTextFile(outFile, 2, True, 0)

#Create the output.xml file
#output.xml must be in the correct format
oTX.WriteLine("")
oTX.WriteLine("")
oTX.WriteLine("" & errCnt & "")
#Number of error encountered in you"re the script
oTX.WriteLine("" & noofwarning & "")
#Number of warning encountered in you"re the script
oTX.WriteLine("false")
oTX.WriteLine("")
oTX.WriteLine("some_message_text_")
#Message to appear in Results -> Messages
oTX.WriteLine("Error ")
#Message to appear in Results -> Messages
oTX.WriteLine("")
oTX.WriteLine("")
oTX.Close()

Set FSO2 = CreateObject("Scripting.FileSystemObject")
Set oTX2 = FSO.OpenTextFile(resultsOut, 2, True, 0)

#Create a Result.txt file. Here you can document errors that occurred
oTX2.WriteLine("Error - unable to open file")
oTX2.WriteLine("Error - Window is Not Found")
oTX2.Close()


The information passed to Silk Central Test Manager is detailed here.


The PERL Script
PerlResults.pls

The WSH Script
outputXmlWriteExample.vbs


Related documents:


Old KB# 24663
Comment List
Related
Recommended