Ask a Question

Junit5 + Zephyr Scale + Gradle project integration

Occasional Visitor

Junit5 + Zephyr Scale + Gradle project integration


My project: Gradle 7.6. + Java 11 + JUnit 5.9.2 + Selenium. Our UI test are run using Jenkins.
Goal: To send tests results to Zephyr Scale (integrated to our corporate Jira)

1) First of all, I tried to follow this instruction ( >  I am getting the following error: 

{"errorCode":400,"message":"Couldn't find any mapped test cases","status":"Bad Request"}

 while the build is Successful, which mean that test results are created. Each test use recommended by you naming approach (key + testCaseName), for example: 


As this did not work for me, I tried the 2nd approach (to generate JSON, instead of xml) :
2) Therefore, I decided to follow another your instruction (

Few questions here:
 2.1. How to register Zephyr Scale JUnit Listener in Gradle project?  Because, you showed only Maven example.

2.2. What is the expected location of test_result.json files in Gradle project?

Really need your help, thanks!

Occasional Contributor

Hi @AlexGnu 

As per this Open issue: Gradle does not support JUnit listeners, so you cannot use this method with gradle.

However in my project I was able to workaround that, using the created JUnit XML reports during build, and upload them to Zephyr using the JUnit XML API in an <Exec> type gradle task to run a command line running a py script.


This py script uploads multiple XML files to Zephyr, editing them so that when the test cases are automatically created (if they don't exist) their name will include just the test method name, without the full package and class names, making it more readable in Zephyr.

Just change the script locally to point to the right xml files folder.

The script can be found here: 

You probably already have an API token, if not you need to create one. Create here: The token should be passed as a '--token <tokenId>' to the script.

Showing results for 
Search instead for 
Did you mean: