Avoid rollback in ATF to delete records

Andre27
Tera Contributor

hi there,

we do have an ATF with test step "Send REST Request" which is calling an instance API to create HR cases. Those created HR cases will not be rolled back after ATF is completed (because it´s a separate API call).

But I like to cleanup those case at the end of my ATF. How can I do the cleanup? Test step "Delete Record" will be rolled back? Can I mark a test step not to be rolled back?

Thanks Andre

8 REPLIES 8

Matt102
Giga Guru

Hi,

There should* be no need. ATFs rollback all work done (on the test instance) during the test run.

(Which is why you should never run them in prod).

hth,matt

* https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0714767

Andre27
Tera Contributor

Hi Matt,

I know ATFs do a rollback OOTB. The issue is the rollback is not working if ATF is calling an REST API on the same instance. In this scenario records (created by REST API via ATF) will not be deleted 😕

Thanks Andre

Apologies, I should have read the question properly.

in an attempt to make amends, could this be helpful?
https://community.servicenow.com/community?id=community_question&sys_id=148f9d0ddb6deb84b1b102d5ca96...

Prolly should dig a bit more but am in a meeting 😞