Getting started with the Automated Test Framework
Summarize
Summary of Getting started with the Automated Test Framework
The Automated Test Framework (ATF) in ServiceNow is designed to help you create, run, and manage automated tests to validate your instance configurations and applications. This guide introduces you to the framework's capabilities, starting with basic test creation and progressing to more advanced features. ATF supports comprehensive testing scenarios, enabling you to efficiently verify functionality and maintain quality across your ServiceNow environment.
Show less
Key Features
- Test Step Configuration Categories: ATF offers a variety of pre-built test step categories to cover diverse testing needs:
- Service Catalog in Service Portal: End-to-end testing of catalog items, record producers, order guides, including variable and price validation, navigation, and ordering processes.
- Application Navigator: Validates the presence and navigation of application menus and modules in the left navigation bar.
- Custom UI: Allows simple user action simulations like setting component values, clicking, and validating text and component states without scripting.
- Form Testing: Enables testing of forms by opening records, setting and validating field values and states, interacting with UI actions, and submitting forms.
- Service Catalog: Similar to Service Portal catalog testing but focused on the standard Service Catalog interface.
- Forms in Service Portal: Tests forms within the Service Portal, including field interactions and UI actions.
- REST: Supports creating and sending inbound REST requests, verifying responses, and testing REST endpoints for CRUD operations.
- Server: Facilitates complex operations such as unit testing JavaScript using Jasmine, testing business rules, script includes, and manipulating test data.
- Output Variables: Many test steps produce output variables that can be reused as inputs in subsequent steps. This enables chained operations such as creating a record and then accessing it as a different user within the same test.
- Custom Test Step Configurations: You can define custom server-side test steps with inputs and outputs to extend the framework’s capabilities. However, custom steps cannot run in the browser.
- Data Preservation: ATF automatically tracks test-generated data and ensures it is deleted or rolled back after tests complete, preserving instance integrity.
- Test Suites: Tests can be grouped into suites that run in a specified order. Suites can be nested, scheduled, and managed to orchestrate complex testing workflows.
- Domain Separation Support: ATF supports domain separation, allowing you to test data and operations within logical domains and control access accordingly.
Practical Application for ServiceNow Customers
As a ServiceNow customer, ATF enables you to automate testing processes, reducing manual effort and increasing reliability of your instance configurations. Starting with simple tests like creating a user record helps build confidence before advancing to complex scenarios involving REST APIs, catalog orders, or server-side scripts. The framework’s built-in data cleanup ensures tests do not pollute your environment. Using test suites and scheduling facilitates continuous testing and integration efforts.
By leveraging ATF, you can efficiently validate functionality after updates, customizations, or integrations, ensuring your ServiceNow instance operates as expected and meets business requirements.
If you are new to the Automated Test Framework, read this overview to learn what the framework can do. Next, follow the tutorial to create and run a test that uses the most basic of ATF features. After you feel comfortable with the basics, explore more advanced features provided by the ATF.
ATF features provide flexibility in how you test your instance.
Test step configuration categories
| Category | Description |
|---|---|
| Service Catalog in Service Portal | Perform end-to-end testing for a catalog item in the Service Portal.
|
| Application Navigator | Create tests to check navigation features.
|
| Custom UI | Create simple tests that mimic user actions with no scripting.
|
| Form | Create tests of forms.
|
| Service Catalog | Perform end-to-end testing for a catalog item.
|
| Forms in Service Portal | Create tests of forms in the Service Portal.
|
| REST | Create and send an Inbound REST request and verify the response.
|
| Server | Perform more complex operations, including the following:
|
Output variables
- Perform a server-side assert on a record that you previously inserted.
- Create a record as one user, and then reopen its form as a different user.
Custom test step configurations
Data preservation
The Automated Test Framework automatically tracks and deletes any data created by running tests, and automatically rolls back changes after testing.
Test suites
Test suites enable you to execute a batch of tests in a specified order. In addition, test suites can be hierarchical, with suites nested within other suites. You can associate test suites with schedules that determine when the system runs the test suites.