How to test applying multiple templates using ATF in a single test case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2025 03:44 AM
Hi all,
I'm trying to test the template functionality on the Incident form using ATF. At the bottom of the form, there's a 3-dot button that opens a pop-up list of templates (e.g., "Incident Call Type", "Major Incident", etc.).
My goal is to create one ATF test that:
Clicks on the 3-dot button to open the template selection pop-up.
Applies each available template one by one.
Verifies that the correct data is populated after each template is applied.
Is it possible to loop through all templates in a single ATF test, or simulate template selection via a script step?
Also, does ATF support interacting with this kind of template pop-up/modal?
Any best practices or workarounds would be appreciated!
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2025 02:34 PM
Hi @monikasilac
No, that’s not possible. You need to understand that ATF (Automated Test Framework) mimics a human tester. Just like a human can’t test everything in one go, the system can’t either.
You can create 3 different test steps or 3 different tests to test each template one by one.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2025 11:54 PM
@monikasilac - You have to create 3 different Tests for the conditions you have mentioned. Everything cannot be tested in one go in ATF

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2025 07:02 PM
Hi monikasilac,
This is one of the issues I find with the manner in which ATF operates. It isn't able to operate in the same manner as a user interacting with the browser in most of the OOTB tests. For the specific use case you're after, you would need to create a custom ATF Test Step Configuration which involves significant scripting experience especially to identify out of the box events for triggering interactions. If you have that experience or a team available to support that effort, you would need to provision the following within the test script:
- Inputs -
Record ID
Table name
Optional glide list input to specifiy templates for optional confirmation user has access required
- Outputs -
none unless you decide there is some useful output data you can leverage later
- Execution Script -
1. Identify whether the template toolbar is visible, toggle on if hidden
2. Toggle All Template Filter with event for "..." icon in toolbar
3. Confirm all templates available within DOM
3a. Evaluate if missing any or any additional based on optional input
4. Start loop (iterate through templates - return error on failure)
5. Fire event for current template in list
6. settimeout for function to confirm presence of template applied message
7. Evaluate field values based on template lookup via GR
8. Fire event for undo template
9. settimeout for function to confirm presence of message (can't remember what the undo message looks like)
10. iterate or end loop
11. Process pass result message
This is a VERY complex TSC however and would take a bit of effort to build but then, it will also take significant effort to maintain as it deals heavily with DOM elements and as such is prone to breaking with each ServiceNow release.
I hope that helps.
Cheers,
Corey