How to verify that an attachment was attached to a record in ATF

_odamai_
Tera Guru

When I run a test with ATF, I can successfully attach a file using "Add Attachments to Form (SP)",
but I'm looking for a way to check whether the file has been confirmed to the target record.

The test shows success when ATF is run, but due to the ATF specifications,
the record is rolled back and I cannot confirm the record with the attached file after running it.

I have already tried the following, but it doesn't work.

① I have selected "Enable for all Steps" for the screenshot property of the test, but I cannot confirm the screenshot of the evidence when the file was attached to the record.

② Even if I add a "Record Query" step and query the file name and table SYSID column in the sys_attachment table, the query does not hit and ATF fails. (Probably it has already been rolled back with the success of the previous step)

Is there any other solution?

Thank you

Best Regards

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

@_odamai_ 

if the test is not yet complete the rollback won't happen and you should be able to verify the file

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 
Thanks for the reply. I guess that's what ATF is all about. I'd love to check it out with a screenshot, but I'm afraid I'd be blindsided ...

@_odamai_ 

did you try that?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 
Yes, I have tried.
I constructed the following ATF steps for the “Pixel 4a” service catalog, as provided in the PDI demo data.
 1.Impersonate
 2.Open a Catalog Item (SP)
 3.Set Variable Values (SP)
 4.Add Attachments to Form (SP)
 5.Order a Catalog Item (SP)
 6.Record Query
 7.Open an Existing Record

Each step succeeds, but still the last “Open an Existing Record” screenshot looks like the attached one, and I cannot confirm that the attachment was correctly attached to the requesting record from the Service Portal.

_odamai__0-1740542356798.png

 

Of course, I have already confirmed that if I manually attach the file through this catalog instead of ATF, the file will be attached to the record in sc_req_item.



@_odamai_ 

Not sure then if ServiceNow is immediately deleting the file after the step succeeds.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader