ATF - Not roll back changes after testing?

lengochoangminh
Kilo Contributor

Hi There,

ATF rolls back changes after testing as default but in some cases, I would like to use the automation to create the testing data. Do we have any option to turn it off? keep the data created after running the ATF?

Thanks

10 REPLIES 10

Hi Abhishek,

 

Can you please elaborate how to set the exclude Rollback as true.

 

 

Thanks & Regards

Vani

ryanpalmer
ServiceNow Employee
ServiceNow Employee

Hey Minh Le,

Changing the behavior of rollback affects everywhere it is used, including patch upgrades and application install/upgrades. Tweaking rollback settings pokes enormous holes in critical safety nets, so you shouldn’t make any changes.

In addition, excluding data from rollback defeats the purpose of using the Automated Test Framework. It is designed to run controlled tests in a controlled and encapsulated environment. If you need to inspect a record created as part of a test, then do so within the test itself using field validation.

See How to Retain Records Created by an ATF Test for Inspection

While that may be how ATF is designed, it means you cannot:

  • Test records E2E
  • Test Integrations
  • Generate Test Data

I believe there is a want for the above features.

I guess putting that flag on all those tables would be a workaround for now.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

I put this attribute on the Incident Table.

After running a test to create an Incident, the data was not preserved.

I also cannot find any documentation on the excludeFromRollback attribute.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

I have tested this on the Incident Table by adding the excludeFromRollback=true attribute.
After executing a test to create an Incident, the Incident is not deleted.
However, the Test Steps do not link to that Incident, which is annoying.

find_real_file.png


I noticed there is no documentation for excludeFromRollback, and this is the only thread on the entire community that makes mention of it.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022