Exporting test cases

Getting data from your test cases repository can be useful to have it handy in any other application where you may need test case details, such as an IDE, a data analysis tool, or even a CLI that can perform any kind of operations with this data.

By fetching test cases details, you should be able to generate artifacts based on your test case design and get customized insights using external tools, such as:

  • Analyze test case design in external tools
  • Generate automated tests from existing test cases

Real examples Use case
Jetbrains IDEs Test management plugin with the ability to auto-generate automated test skeletons

Getting test cases

To analyze your test case design and manage your test cases outside TestRail, for instance, using a test automation tool, you will want to fetch the information from your test cases.

Request Request Body Example Response Body Example

GET index.php?/api/v2/get_cases/{project_id}

curl -X GET \ 
  -u "user@example.com:password" \ 
  "https://example.testrail.io/index.php?/api/v2/get_cases/3"


Filtering test cases with query parameters

  • Get all the test cases that are in project 34 (project ID of 34), suite with ID of 2 and priority 3 or 4
    GET index.php?/api/v2/get_cases/34&suite_id=2&priority_id=3,4
  • Get 10 test cases from project 34
    GET index.php?/api/v2/get_cases/34&limit=10
  • Only returning test cases from project 34 starting the offset number
    GET index.php?/api/v2/get_cases/34&offset=5
  • Filter cases in project 34 with a filter string of "login"
    GET index.php?/api/v2/get_cases/34&filter=login
  • Combined usage
    GET index.php?/api/v2/get_cases/34&offset=5&limit=10&filter=login

 

Was this article helpful?
1 out of 9 found this helpful