1

I am currently using test rail in conjunction with Selenium testing but the issue is that I want to be able to automatically update the test run id every time I run a full regression.

My tests are broken into different sections (login, registration ) and now I have to go into every test and connect each different case to each section as they all have different run ids. Is there any way I can get these ids from test rail automatically at the start of each test run?

Daniel
  • 2,355
  • 9
  • 23
  • 30

1 Answers1

1

I think You got this all mixed up.

Logic is this,

  1. testcase have their own ID's
  2. test-run have their own ID's, and they can have one or 100 testcases (consists of case ID's)

So You first have to create testcases manually. Eg. You would have 10 of them.

Second step is to create TestRun, (from gurock documentation),

POST index.php?/api/v2/add_run/:project_id

(:project_id=can be found under project name, so API can know to which project You are creating Testrun)

and this is its payload:

{
    "suite_id": 1,                  //suite ID, usually is Master num. 1
    "name": "This is a new test run",
    "include_all": false,
    "case_ids": [1, 2, 3, 4, 7, 8]  //testcase ID's
}

You can try (test) this in Postman. Put POST enter Your testrail endpoint something like thishttps://testrail.net/index.php?/api/v2/add_run/1234 and ind body and payload from above (json)

And when You do this You should now have testrun with 10 testcases in it.

Screenshot (Postman) enter image description here

And when You catch logic how this works, all is about in reference for each object.

Testcase reference is ID=C1, TestRun=TR1, Project ID = IM1, and You just assign object to object. Testrun consist of testcases, which You assign in "case_ids": [1, 2, 3, 4, 7, 8] //testcase ID's etc.

Hope this help at least a bit,

Kovacic
  • 1,473
  • 6
  • 21
  • I have all my test cases already created, my main issue is when i create a new regression test, all the run ids change. Ive created a test suite fro my regression tests, but the id from the suite doesnt work so i have to use the ids from all the different sections within the suite. This is time consuming. I need some sort of java code that can create run ids or get them automatically but ive no idea how to use this api with java and selenium – fearghal O reilly Jul 12 '18 at 10:14