IT CanvassTalk to an advisor
Development · LessonReviewed by Sneha I, ServiceNow Trainer, 8 yrs · Updated · Published · current release · intermediate

ServiceNow Automated Test Framework

Catch regressions before an upgrade catches you.

Quick answer

The Automated Test Framework builds repeatable tests from a catalog of steps: open a form and set fields, run a server script, order a catalog item, call a REST API, and assert the result. Tests group into suites you schedule after an upgrade in a sub-production instance. It is never enabled in production, because tests create and change real records.

Key takeaways
  • Tests and test steps
  • Test Suites & scheduling
  • Where and how to run it
  • Why it matters for upgrades
  • Common mistakes

The Automated Test Framework (ATF) lets you build repeatable tests of your instance, forms, catalog items, REST APIs, workflows, so an upgrade or a new update set doesn't silently break what already worked. It turns regression testing from days of manual clicking into an automated pass/fail run.

Tests and test steps

A Test is a sequence of Test Steps chosen from a large catalog. Steps pass data down the chain, so step 3 can act on the record step 2 created:

Form steps
Open a new/existing record, set field values, submit, assert field state.
Server steps
Run a server script, query a record, assert a value.
Catalog steps
Order an item, set variables, assert the request/RITM.
REST steps
Call a REST API and assert the response.
Impersonate
Run subsequent steps as a specific user, test ACLs.

Test Suites & scheduling

Group related tests into a Test Suite and schedule it, for example, run the full regression suite automatically after every upgrade in the sub-prod instance, and read the pass/fail report before promoting.

Where and how to run it

Run ATF only in sub-production. There is an explicit property to enable it, and it must never be on in production, tests create and modify real records. A dedicated test browser session runs the UI steps.

Why it matters for upgrades

ServiceNow ships two family releases a year. A maintained ATF suite makes upgrade regression testing repeatable and fast, the difference between a confident upgrade and a nervous one. It is also the safety net that lets you accept new features without fear of silent breakage.

Common mistakes

  • Enabling ATF in production.
  • Writing brittle tests tied to exact UI text that changes each release.
  • Building tests once and never maintaining them as configuration evolves.
  • Testing only the happy path and missing the failure branches.
Try it YourselfJavaScript
▸ Press Run to execute.

Runs in a sandbox in your browser. Mock gs and GlideRecord and sample data are provided.

Practise this on your own free instance.
Set up your free instance →
Already working on ServiceNow and stuck on a live ticket?Get an expert ServiceNow developer on screen-share to finish your daily tasks with you. Deliver on time, protect your reputation and your job. Monthly support only, no task-wise plans.Task assigned · no idea where to startStill stuck · your job on the lineExpert joins your screenDelivered on timeExplore On Job Support