ATF ITSM Testing - REST API and Incident Creation?

joelpomales
Giga Contributor

Hello all.

 

I successfully built a REST API POST query that creates an incident in the table. I put that as a step in an ATF test and sure enough, the test step passes. *But*, if the next step is a record query step (to validate that the record was indeed created) it fails.

 

Can I presume that the next step of this step is for a *record insert* test step, since ATF won't necessarily create the incident from the send REST Request step?

1 ACCEPTED SOLUTION

Kieran Anson
Kilo Patron

Hey,

As part of your step sequence, are you using a step after your inbound rest step to asset the status code and response? The inbound rest step will always pass, following assertion steps are needed to validate whether the API calls actually did anything

View solution in original post

3 REPLIES 3

Kieran Anson
Kilo Patron

Hey,

As part of your step sequence, are you using a step after your inbound rest step to asset the status code and response? The inbound rest step will always pass, following assertion steps are needed to validate whether the API calls actually did anything

I found this article up on docs: https://www.servicenow.com/docs/bundle/yokohama-application-development/page/administer/auto-test-fr...

 

What I want to understand is this: why is the record insert step before the inbound REST request, and why is it GET and not POST. If I'm sending records (for example, incidents) from an external tool, shouldn't I be using POST?

That example isn't for testing record creation via a REST integration. It's to test whether a REST integration can retrieve a record. The record creation step exists prior to create a known record to then utilise in the GET REST step.