Meetup Lab: Automated Test Framework — Test Smarter, Not Harder
This lab from the May 2019 ServiceNow Developer Meetup walks through setting up Automated Test Framework tests for Incident Management requirements. Authors: Mike Hedlund, Scott Halverson.
This lab originally from the sndevs meetups repo and hosted on GitHub Pages.
Lab Setup
Import the ATF Demo Update Set into your instance before starting.
Create a Test for IM_001
Requirement: The ‘ATF is Great’ field shall be ‘read-only’ to all users.
- Under ‘Automated Test Framework’ select the ‘Test’ module and click ‘New’
- Name:
(ATF) IM_001, Description: The ‘ATF is Great’ field shall be ‘read-only’ to all users. - Add Test Step → Server → Impersonate — User:
ITIL User - Add Test Step → Form → Open a New Form — Table:
Incident - Add Test Step → Form → Field State Validation — Read only:
ATF is Great - Select ‘Run Test’ and confirm all steps pass
Create a Test for IM_002
Requirement: The ‘ATF Demo Notes’ field shall only be visible when the Category field has a value of ‘ATF Demo’.
- Create new Test:
(ATF) IM_002 - Add Test Step → Server → Impersonate — User:
ITIL User - Add Test Step → Form → Open a New Form — Table:
Incident - Add Test Step → Form → Set Field Values — Short description:
Test, Caller:ITIL User, Category:Software - Add Test Step → Form → Submit a Form — Assert type: ‘Form submitted to server’
- Add Test Step → Form → Open an Existing Record — Reference the record submitted in step 4
- Add Test Step → Form → Field State Validation — Not visible:
ATF demo notes - Add Test Step → Form → Set Field Values — Category:
ATF Demo

- Add Test Step → Form → Field State Validation — Visible:
ATF demo notes - Run Test and confirm all steps pass
Create a Test for IM_003
Requirement: The ‘ATF Demo’ button shall only be visible to Users with the ‘atf_demo’ role.
- Create new Test:
(ATF) IM_003 - Add Test Step → Server → Impersonate — User:
ITIL User - Add Test Step → Form → UI Action Visibility — Not visible:
ATF Demo - Add Test Step → Server → Impersonate — User:
Auto Test - Add Test Step → Form → Open a New Form — Table:
Incident - Add Test Step → Form → UI Action Visibility — Visible:
ATF Demo - Run Test and confirm all steps pass
Create a Test for IM_004
Requirement: A new section shall be added to the Incident form named ‘ATF Demo’ with the ‘ATF is Great’ and ‘ATF demo notes’ fields.
- Create new Test:
(ATF) IM_004 - Add Test Step → Server → Record Query — Table:
sys_ui_section, Caption:ATF Demo - Add Test Step → Server → Record Query — Table:
sys_ui_element, Element:u_atf_is_great, Sys UI Section.table:incident, Sys UI Section:ATF Demo - Repeat step 3 with Element:
u_atf_demo_notes - Run Test
Create a Test for IM_005
Requirement: A notification shall be sent to the ‘Caller’ when an Incident record is created.
- Create new Test:
(ATF) IM_005 - Impersonate User:
ITIL User - Open a new Incident form
- Set Field Values: Short description:
Test, Caller:Auto Test - Submit the form
- Select custom test config ‘Notification Check’
- Notification:
Incident opened for me, Document: record from step 4, Recipients:[email protected] - Run Test
Create and Run the IM Test Suite
- Under ‘Automated Test Framework’ select ‘Suites’ and click ‘New’
- Name:
IM Test Suite, Description:ATF Demo - Add each of the 5 individual Tests to the suite
- Select ‘Run Test Suite’ and confirm all pass
