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

Testrail API - elapsed field shows same timespan

Hi, I’m using Testrail API to post the elapsed timespan, let’s say I have 2 post data like this:

{
  status_id: 5,
  comment: "This test is failed due to **expected 'Kenneth' to deeply equal { name: 'Kenneth', job: 'leader' }**",
  elapsed: '2s'
}
{
  status_id: 5,
  comment: "This test is failed due to **expected 'Irwin' to deeply equal { name: 'Irwin', job: 'leader' }**",
  elapsed: '3s'
}

Now using addResultForCase api to post those data, I got the following reponse:

{
  id: 98,
  test_id: 299,
  status_id: 5,
  created_by: 1,
  created_on: 1581931815,
  assignedto_id: null,
  comment: "This test is failed due to **expected 'Irwin' to deeply equal { name: 'Irwin', job: 'leader' }**",
  version: null,
  elapsed: '3s',
  defects: null,
  custom_step_results: null,
  attachment_ids: []
}
{
  id: 97,
  test_id: 298,
  status_id: 5,
  created_by: 1,
  created_on: 1581931815,
  assignedto_id: null,
  comment: "This test is failed due to **expected 'Irwin' to deeply equal { name: 'Irwin', job: 'leader' }**",
  version: null,
  elapsed: '3s',
  defects: null,
  custom_step_results: null,
  attachment_ids: []
}

The elapsed timespan is 3s for both. I would assume this should be 2s, 3s respectively. Any advice on this is much appreciated.

1 Like