How to handle mandatory attachment field on a form in ATF?

Mayank Das3
Tera Contributor

Hello all

 

I have a custom attachment field on the change request form which I need to automate using ATF. How do I handle the mandatory attachment field using 'Set Field Values' step?

 

I have already tried to use 'Record Query' to query a random attachment on the 'sys_attachment' table but it does not allow me to refer on the 'Set Field Values' step.

 

Hard coding the sys_id of a random attachment on the field also did not work.

 

Please help!

MayankDas3_0-1762156404534.png

 

2 REPLIES 2

Ravi Gaurav
Giga Sage

Hi @Mayank Das3 
To add a mandatory attachment in Automated Test Framework (ATF) for a form, you need to use a workaround since standard "mandatory" fields are not supported for attachments. A common approach is to use the "Add Attachment" step in the ATF, and on the form, use a client-side script or a business rule to enforce the attachment requirement before submission.