Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

How to upload mandatory Service Portal Attachment Variables in ATF before submitting a Record Produc

Santhosh15
Tera Guru

Hi Team,

I am working on an ATF test for a Service Portal Record Producer that creates a Case (sn_customerservice_case).

The Record Producer contains two mandatory attachment variables:

  • Original Invoice (original_invoice_used)
  • Replanted Invoice (replanted_invoice)

When inspecting the widget, I can see the variable type is rendered as:

 

HTML
ng-switch-when="sc_attachment"

and the Upload button calls:

 

HTML
ng-click="openAttachmentSelector($event)"

 

There is also a hidden file input:

 
HTML
input type="file"
 
ng-file-select="onAttachmentSelect($files)">

My ATF currently uses:

  1. Open Service Portal Page
  2. Open Record Producer (SP)
  3. Set Variable Values (SP)
  4. Submit Record Producer (SP)

The issue is that the attachment variables are mandatory and ATF cannot submit the form unless files are uploaded.

I do not see a "Set File" ATF step in my instance.

 

Questions

  1. Has anyone successfully automated uploading files to sc_attachment variables in a Service Portal Record Producer using ATF?
  2. Is there any OOB ATF step available for attachment variables in Service Portal?
  3. Can attachment variables be populated through a Custom UI Step or Client Test Runner step?
  4. What is the recommended way to test Record Producers with mandatory attachment variables in ATF?

Any examples or best practices would be greatly appreciated.

Thanks in advance!

 
0 REPLIES 0