2

I'm trying to integrate my automation tests with TestRail. I work with c#. I use the API of TestRail in my test project. I create TestRun manually and have testRun id and test case id. I have a problem when my test case is located in nested directories(in som test suites tree) not in the root of testSuites. Returned error message is:

TearDown : AutomationSport.Tests.TestRail.TestRailAPIException : TestRail API returned HTTP 400 ("No (active) test found for the run/case combination.")

But when my test case is in root directory, testrail integration works correctly and it set test case status in TesrRail correctly. How should I get a test case id in that case?

HiSura
  • 132
  • 8

1 Answers1

0

I've found a correct solution. To be able to add a test result to the TestRail run, you need to include the case to the run. You can do it in two ways:

  1. POST index.php?/api/v2/update_run/{run_id} with the body:

    { "include_all": false, "case_ids": [1, 2, 3, 5, 8] }

But take into account that only case_ids will be included, if you had some tests in the run before - they will be excluded.

  1. POST index.php?/api/v2/update_run/{run_id} with the body:

    { "include_all": true }

In this case all cases from the suite will be included.

Dmitrij Abashin
  • 351
  • 3
  • 7