Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Importing the TestRail API into IntelliJ


Hello all,

I’m currently trying to set up some TestRail customisation with Selenium. To create the Selenium scripts I’ve set up IntelliJ to use the Selenium webdriver, and then using JUnit @Test cases within that. So what I want is to pass the results from each of the @Test cases into TestRail.

However, I’m new to IntelliJ and I’m struggling to work out how to integrate with TestRail, I’ve read the API Binding information on but I can’t work out how to import that into IntelliJ.

Is anyone able to help please?


Hello Mark,

Thanks for your posting. We don’t have experience with IntelliJ ourselves but the binding has just a couple of regular .java files so they should be easy to add to your project. I believe you would just need to copy the .java files to your existing project (directory).



Hello Tobias,

Thank you for your help, I’ve been able to resolve this perfectly.

Many thanks



That’s great to hear, Mark, happy to help :slight_smile:



Hi Mark,

Can you please tell me, how you manage to fix the TestRail API integration with IntejjIJ ?




Did you try what was suggested in the second post?


Yes, but with no luck .

This is the testrail code part

@Then("^I will automatically update the result of test case with (.*)$")
public void iWillAutomaticallyUpdateTheResultOfTestCaseWithStatusId(final int status) throws Throwable {

    APIClient client = new APIClient(clientAPI);
    Map data = new HashMap();
    data.put(status, 3);
    data.put("comment", "Test 1 ");
    JSONObject r = (JSONObject) client.sendPost("add_result/3287", data);

and I’ve got this error


According to the error it does not know what the host is for Test Rail.

From the link in the first post:


The API needs to know where to find the Test Rail host.


I have :
public void setUp() {
String prop= System.getProperty(“Path”);
properties = new Properties();
try {
properties.load(new FileInputStream(prop));
clientAPI = properties.get(“TestRailAPI”).toString();
} catch (IOException e) {
throw new RuntimeException("Properties file not found: " +prop);
} ,

where the test rail host is added in a properties file :