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

Sort Test Run by Elapsed Time

The Elapsed column in a Test Run stores the time it took to run a certain test case. But when I sort the test cases by Elapsed column descending, it does not seem to sort by actual time value i.e. the test case with longest elapsed time on the top and the one with shortest time at the bottom. I think, it is sorting them as a string instead of time which does not really serve the purpose of sorting by Elapsed column.

Is there any solution for this?


Hi there,

Thanks for the detailed post! This is a known issue that was recently discovered, and I’ve added your feedback to the internal report. I can’t give any specific time frame for when a fix will be sent out, but we will be looking into it in future TestRail versions.

As a workaround for now, we would recommend exporting the test run into a CSV or Excel file, then using the sort function in the spreadsheet to get a more accurate idea of the elapsed values in sequence.

Again, thanks for the feedback and do let us know if you have any other questions.

Thanks Jacob, for escalating the issue further.

Yes, I am already using the suggested workaround.

Just a tip for other users: In Excel, the downloaded .csv file has Elapsed values in the format of “123s” which is also treated as a String in Excel and hence does not really sort numerically (largest to smallest). In order to achieve that, just follow the steps below:

  1. Export the Test Run to Excel from Test Rail.
  2. Include Elapsed in the layout.
  3. Open the report in MS Excel.
  4. Create a new Time column besides Elapsed column.
  5. Apply this formula =NUMBERVALUE(REPLACE(B2, LEN(B2), 1, “”)) in the first cell below the heading. Make sure to enter the respective Elapsed cell’s address.
  6. Select and drag down to apply the formula to rest of the records.
  7. Sort the Time column from largest to smallest or vice versa.
  8. Save it as .xlsx

It will remove the succeeding “s” from Elapsed time values and convert the string into number which can be sorted by largest to smallest or vice versa, instead of A to Z or Z to A in Excel.


1 Like