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

Keeping up with changing run ids


I have been able to set up testrail with java and selenium, i am currently using the method public static void addResultForTestCase(String testCaseId, int status,
String error) throws IOException, APIException {

    String testRunId = TEST_RUN_ID;
    APIClient client = new APIClient(RAILS_ENGINE_URL);
    Map data = new HashMap();
    data.put("status_id", status);
    data.put("comment", "Test Executed - Status updated automatically from Selenium test automation.");
    client.sendPost("add_result_for_case/"+testRunId+"/"+testCaseId+"",data );


and calling it to each test. But the issue im having is that each regression the run id changes so i have to manually change it every time i make a new test run, is there any way this can be updated automatically as ill be using the exact same regression plan every time, but going into each section and getting the run id is time consuming. Ive seen that there is a way but i dont know how to integrate it into java