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

Why do Test Cases get deleted when a Test Run is deleted?

Hi there,

I just deleted a Test Run, but before I did - I got a message saying that 2,000+ test cases would be ‘irrevocably deleted’ in the process.

This must be because the test run automatically added all test cases at creation as no specific test case collection was specified otherwise.

Anyway, because I paid attention, I cancelled the Delete and changed this selection so that just one test case was associated to the Test Run (I was not allowed to save the test run with no selected test cases - I’m not sure why).

I then went to delete the Test Run again and once again got the test cases will be ‘irrevocably deleted’ warning, but this time went ahead and confirmed the deletion of the Test Run as there was only one associated case this time.

The Test Run has now been successfully deleted - but so has the one test case I had to have associated to it.

My question is why did this test case (or why do all associated Test Cases) get deleted when I deleted the Test Run?

This is an unwanted feature for me and my team. My Test Cases should remain when deleting Test Runs as far as my workflow is concerned.

Can anyone please explain the rational here for these test cases being deleted along with the Test Run?

Thank you

is the message really about deleting of test cases?
As far as I remember (no installation available), it is about deleting tests, not test cases. And this is right.

Whenever you create a Test Run you have to associate at least one test case - the client is asking you to do so (can’t remember the API). That’s simply how TestRail is working, probably the dev team doesn’t like to have empty test runs…
The assosicated test case results in a test, which might have multiple results later on.
If you delete the test run, also these tests will be deleted. In fact they still exist in the db, but you can’t reach them anymore because the run can’t be selected anymore and there is no official way to get him back.

For me this is just a hint, informing you about the fact. The test cases won’t be deleted from the related test suite - if there isn’t a bug.

Does the single Test case from the run you have deleted still exists in the suite? I guess yes.

Hope this helps,

Thanks Karsten - I had searched the Test Suite for the single Test Case and could not find it - which is why I thought it had been deleted. I will check again at lunch time and confirm - I may have got it wrong - it was the end of a very long day.

Your response is reassuring though - I really appreciate you taking the time to write it out and it all makes sense. Shall report back! Thanks