Search code examples
jenkinsjmetertestlink

integration issue with testlink jenkins and Jmeter


I have JMeter setup on Jenkins. I am running some performance test with it. On Jenkins, I have setup the TestLink plugin. On JMeter, I have 'View Results Tree' tree setup, and export the results to a xml file. With the results with the following format:

<testResults version="1.2">
<httpSample t="81" lt="81" ts="1463588977147" s="true" lb="Unit_EdgeSpanTest_transmission-submit_Case1" rc="200" rm="OK" tn="CinemaCMSAPITest 1-1" dt="text" by="382">
  <assertionResult>
    <name>Response Assertion-ResponseCode</name>
    <failure>false</failure>
    <error>false</error>
  </assertionResult>
  <assertionResult>
    <name>Response Assertion-TextResponse</name>
    <failure>false</failure>
    <error>false</error>
  </assertionResult>
</httpSample>

Now I have problem get JMeter results report back to testLink. Googled, not much resource out there tell me what to do. I could only find one resource from Jenkins:https://wiki.jenkins-ci.org/display/JENKINS/Integrating+TestLink++Jenkins++JMeter

But it did not help much. I am not using Ant...

Does anyone has successfully made this work? And could give me some hint of what to do?

Thank you very much in advance!


Solution

  • I followed the instruction described in the question to configure the testLink, JMeter, and Jenkins. Just with one problem: I first tried to use the script from the link above, but it seems always returned the wrong result. I wrote a simple java script to transform JMeter XML test result file to TAP format. Except that the link from the question is a good instruction to follow to setup the integration between JMeter/Jenkins/TestLink:

    To summarize:

    From Jenkins:

    1. install TestLink plugin
    2. Configure TestLink from Jenkins > Configuration
    3. Create a project > Configure:

      • Invoke TestLink: Put the TestLink Version/Test Project Name/Test Plan Name/Build Name/Custom Fields/Test Plan Custom Fields according to the settings from the TestLink.
      • Add build action to run the java function/shell script
      • Result Seeking Strategy: Add the tap directory in 'Include Pattern' Add JMeterTestCase to Key Custom Field.

    From TestLink:

    1. Create custom Fields,
    2. Add the JMeterTestCase custom field to test specs. And set the test specs to 'Automated'
    3. Assign the test specs/cases to the according test plan.

    From JMeter:

    1. Make sure the test result listener generates xml format result.

    Have a script transform JMeter Test result from xml format to Tap format.

    In the link from the question, it has a script for doing that, and I also attached a simple script wrote in Java for transforming JMeter Result xml file to TAP file in java: https://github.com/yueran/jmeterResult_xmlToTap