Forum Discussion

karl_d's avatar
karl_d
New Contributor
11 years ago

Results Generation - TestLink/Jenkins Compatible Formats (XML?)

Hello all,

 

I'd like to generate a simple test results file that can be parsed and processed into TestLink (via Jenkins).

 

Currently, we have a convoluted process that sits amongst some legacy code, whereby results are stored on-the-fly in some array and finally written to file (in an arbitrary format) where they are fed to a proprietary application that has some connection to TestLink (via the TestLink API).

 

I understand very little of what this legacy code is doing and due to major performance and stability issues with this setup, I need to rewrite the logging module that we use to do this in a cleaner way.

 

My aim is to write some very simple output (XML?) to a file, that Jenkins can automagically pick-up and process via the Jenkins/TestLink plugin. As far as I can discern, the output file needs to be in either: TestNG, JUnit or TAP format.

 

I know almost nothing about any of these things. Can anyone else provide me with further (or any) useful guidence with this?

 

Specifically, I'm having trouble understanding exactly where I can grab the test unit results from (post execution, or at the end of execution) and then write these in the appropriate format, according to the above.

 

Our test units are all scripted (in JScript) and conveniently start with a call to "PreTestCase()" and finish with a call to "PostTestCase()". I'm hoping to strip out any results handling code in these functions and replace with my new solution. Incidentally, before each run, we call "PreTestSuite()" and finish with "PostTestSuite()" if that helps too.

 

The only other alternative is to parse and convert the native TestComplete log, but this looks to be an even larger task.

 

Best regards,

Karl.

2 Replies

  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor

    Not sure if this fits your needs, but there is a built in method for saving to XML.

    You can use the Log,SaveResultsAs method to save as XML.

    The log location can be found with the Log.Path property.

    • karl_d's avatar
      karl_d
      New Contributor

      Thank you for the reply, those will certainly be useful.

       

      I've made some progression, in that it may be possible using this information: http://support.smartbear.com/viewarticle/56317/#Scheme

      ...to come-up with a method of taking the TestComplete native XML logs and converting them (via some XSL template?) into a JUnit format (such as described here: https://pzolee.blogs.balabit.com/2012/11/jenkins-vs-junit-xml-format/).

       

      I'm completely new to handling XML in this way and have not written an XSL template before. I'm guessing I need to work out some appropriate mapping between the TestComplete XML and the JUnit XML and match this up in the XSL file.

       

      Rest assured, once I do this, I'm posting the solution here! there a various forum and blog entries dotted around the Internet, but nothing that really states a solution. :smileyhappy: