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

Extracing test result based on user id and date


#1

Hello,

I have a problem that my test results on TestRail were overwritten by someone and two different test results were mixed together in a test run. My questions are:

  • Is it possible to extract certain test results from the database of TestRail using a SQL query with the condition of user id and the date tested on and make another test run to the database of TestRail?
  • In case that database’s record modification directly is not supported, is it possible to do with TestRail’s APIs? There are only get and add functions in the “Results” related APIs and there is no API that I can extract certain parts from a result using parameters such as user id (‘created_by’) and date (‘created_on’).

Let me know if you have any suggestions or comments.
Thanks.


#2

Hi Daniel,

Thanks for your post! Please note that you should never directly write to or change anything in TestRail’s database. This would break the consistency of the database, even small changes you might find unproblematic, and your TestRail instance would be immediately unsupported. You wouldn’t be able to upgrade anymore and we wouldn’t be able to support the instance anymore. So please never write/change anything in TestRail’s database, and use the TestRail API where available instead.

In regards to fixing the results in your situation, we would just recommend adding a new result to the tests to override the previous result, and TestRail would always use the latest result for status statistics/reports. You wouldn’t need to make any changes to the existing results, and you can add a comment to the test to clarify any incorrect results that were added previously if needed.

Hope this helps!

Regards,
Marco