How to add attachment by using ATF?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2018 08:11 AM
I am searching for a way to add an attachment using ATF. This is the script I have used :
(function(outputs, steps, stepResult, assertEqual) {
// add test script here
var t = steps('5311cd384fdd1bc4e72f029d0210c777').record_id; //sys_id of the change request
var ga= new GlideRecord('sys_attachment');
ga.initialize();
ga.file_name = 'test_attachment';
ga.content_type='image/jpeg';
ga.table_name = 'change_request';
ga.table_sys_id = t ;
outputs.table = 'sys_attachment';
outputs.record_id = ga.insert();
})(outputs, steps, stepResult, assertEqual);
I don't know how to add content in the attachment. In the change form this attachment is getting added so further steps are fine too, but there is no content.
- Labels:
-
Automated Test Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2019 11:11 AM
My company is also looking for this functionality within ATF. Has anyone been successful adding an attachment as an ATF step?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2020 11:05 AM
Hi,
We have new steps to support the following cases in the New York release:
- Form - Add Attachments to Form
- Server - Add Attachments to Existing Record