You can use your tests in Jenkins.

All you have to do is create a new job and add a build step to run a shell command. First use Add build step and select shell.

Using htf command-line-utility

The easiest way to run your tests is to put them all into a folder called tests/ and then add the following in your buildstep

htf --html_report=testreport.html --junix-xml-report=results.xml tests/

Using a shell-script

If you have many tests or only want to run specific tests htf command-line-utility could also do this job. But you would have to edit the Jenkins job all the time. Or maybe you want to run tests in a specific order.

A better way is to write a shell-script (eg. that runs htf with the tests to be run.

Enter the following in your build step

and put


htf --html_report=testreport.html --junix-xml-report=results.xml


Using a python-script

You can also create a python script (eg. that is run within the build step.

The shell command should be a call to the Python-interpreter python or python.exe followed by -u to enter unbuffered mode and followed by the script name.

python -u

Make sure the environment variable $PYTHONPATH is set correctly. If you need distinct workspaces $PYTHONPATH (and other environment variables) can be set using the EnvInject-plugin.

An example script could look like:

from __future__ import \
    absolute_import, division, print_function, unicode_literals

import htf

if __name__ == '__main__':
    tests = [

    htf.main(title="An example test for Jenkins",

Using XML-reports in Jenkins

Jenkins can use the XML-testreport with xUnit-plugin or the JUnit-plugin.

Use "Add post build action". Select "Publish xUnit results". Select add and select "JUnit" and enter "*.xml" for example.