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

Create Run Api using Java


#1

Hi Guys im trying to create a java post request to create a test run on test rail, however it deosnt seem to be working heres my code:

public JSONObject AddTestRunTest() {
    JSONObject jsonobject = new JSONObject();
    APIClient client = new APIClient("https://testsport.testrail.com/index.php?/api/v2/add_run/24");
    client.setUser("for@stdec.com");
    client.setPassword("Password1");

    Map<String, Integer> myMap = new HashMap<>();
    myMap.put("suite_id", 829);
    myMap.put("assignedto_id", 1);

    Map<String, String> myMap1 = new HashMap<>();
    myMap1.put("name", "Regression Test");

    Map<String, Boolean> myMap2 = new HashMap<>();
    myMap2.put("include_all", true);

    ArrayList<String> arr = new ArrayList<String>();
    arr.add("17082");
    arr.add("17085");
    arr.add("17086");


    return jsonobject;
}