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

Sharing test cases between suites


#1

Hello. I wanted to know how to share test cases between suites. I think we had this option before (but not 100% sure). Why do I need this? Becase we use automation in different environments, so we need to have multiple test runs with different test groups… but I need to use the same tests in different suites (or groups). Also, sometimes it would be good to use those tests for manual testing.

Is there any other option? Do test plans work for that?

I’m asking because in the “add_result_for_case” method there’s a suite_id param, and I used to use that when testing in the sandbox.

Thanks!


#2

Hi Hugo,

Thanks for your posting! Sharing/linking test cases between test suites is not possible and we would usually recommend using just a single test suite if at all possible (TestRail 4.0 also introduced a new single-suite mode). Using a single suite has many advantages over multiple suites as it makes it much easier to create test runs for the entire case repository or an arbitrary subset thereof. I can recommend reviewing our 4.0 announcement from last year to learn more:

http://blog.gurock.com/postings/introducing-testrail-4-0/2757/

(see “Suite Modes and Baselines”)

The add_result_for_case API method also expects a run ID instead (and not a suite ID), so this method would be independent of the actual suite or case repository.

I hope this helps!

Regards,
Tobias


#3

Hi Tobias,

The problem is that when I start a Test Run, the test run contains all the tests of the project.

add_result_for_case works well for us when the test passes, but the problem is: when testing only 1 suite, I’m able to see how many tests run and how many tests didn’t run (and that’s what I want). But when testing the whole project, I can’t difference between tests that didn’t run and tests that I wasn’t planning to run anyway.

Is there any way to specify a subset of all the tests when creating a test run?


#4

So, the method I’m talking about is add_run. It seems that I can pass a parameter called case_ids, and specify a subset of all tests.

It would be nice to have something like a section_id paramenter, but I guess I’ll use case_ids for now.


#5

Hi Hugo,

Yes, you can specify the case selection via the case_ids and include_all (-> false) options when creating a test run or plan. This allows you to limit and customize the selection of cases:

http://docs.gurock.com/testrail-api2/reference-runs#add_run

(see “Request example”)

I hope this helps and please let me know in case you have any further questions!

Regards,
Tobias