- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2017 09:24 AM
Does anyone have input as to how to use the ATF for applying templates to a form?
Manual action requires that the user click on the hamburger and from the options selects "Templates" and then "Apply Template" and then selecting the specific template.
I'm looking to write automated tests that use templates for testing different forms and application areas (screenshot above is for Project) and need help to know how to apply templates to an automated test.
Has anyone tried this or know if this is functionality is available and I'm just missing it, or if it is absent, when it might be available?
Thanks in advance for the input!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 04:04 PM
1. Go to 'Step Configurations'. New. Fill out the form as follows:
Description generation script:
(function generateDescription(step) {
var descriptionGenerator = new ATFStepDescriptionGenerator();
var description = gs.getMessage("Insert a record into '{0}' and apply template", step.inputs.u_table);
description += descriptionGenerator.getConditionDescription(step.inputs.u_table);
return description;
})(step);
Step execution script:
(function executeStep(inputs, outputs, stepResult) {
//check template and get template name
var template_name = '-';
var t = new GlideRecord('sys_template');
if(t.get(inputs.u_template)){
template_name=t.name;
//check if template exists for the selected table
if(t.table != inputs.u_table){
stepResult.setOutputMessage("Template: "+template_name+" doesn't exist for this table: "+inputs.u_table);
stepResult.setFailed();
}
else{
//Create record and apply template.
var inc = new GlideRecord(inputs.u_table);
inc.initialize();
inc.applyTemplate(template_name);
var id = inc.insert();
outputs.u_record_id = id;
stepResult.setOutputMessage("Record Created: "+id);
stepResult.setSuccess();
}
}
else{
stepResult.setOutputMessage("Could not find name of the template with sys_id: "+inputs.u_template);
stepResult.setFailed();
}
}(inputs, outputs, stepResult));
2. Save.
3. Add Input Variables on the Step Configuration form:
4. Add Output Variables on the Step Configuration form:
5. Test it.
Let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2017 07:08 AM
Hi, Masha.
The final resolution for getting the tabs to show:
Navigate to System UI > Views
In "UI Views," select "advanced."
In "Forms" tab, select "atf_input_variable."
In hamburger, select "Configure" > "Related Lists"
Add "Form Section->Sys UI Form" to "Selected" pane.
Thanks again for all your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2018 03:49 PM
Hello Masha,
I wondering if there is a way to open the list view in ATF. I need to test the List banner button which is available only in the list view and not on the form.
The API is not clear regarding how open form is working other than using Testexecutor AJAX but thats of no use to me since I already know the URL.
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2019 01:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2020 12:26 PM
I have the same issue in New York version and submitted a case with HI. The tech was able to replicate the issue and created a problem ticket PRB1427888. He also found a way to solve the issue and documented his work on CS4815696.
Adding the information here in case someone is trying the steps on this article.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 12:09 AM
Hi
I am facing the similar issue. I can attach the template when I try to query the record It says "no record found" I tried opening the problem record you have mentioned but I couldnt open.
It would be great If you could let me know the steps here, so I can try it out. Already logged a ticket with 'Hi' but no response yet.
Attached the screenshots for your reference.
Thanks,
Rini