Getting started with the Automated Test Framework
Summarize
Summary of Getting started with the Automated Test Framework
The Automated Test Framework (ATF) in ServiceNow enables you to create, run, and manage automated tests to validate your instance’s functionality. It provides a flexible set of features for testing various components such as forms, catalogs, navigation, REST endpoints, and server-side scripts. The framework automatically manages test data by tracking and rolling back changes after tests run, ensuring no residual test data remains.
Show less
Key Features
- Test Step Configurations: ATF supports multiple test step categories tailored for different areas, including:
- Service Catalog and Service Portal: Perform end-to-end testing for catalog items, record producers, order guides, and forms, including setting and validating variables, prices, quantities, and submitting orders.
- Application Navigator: Verify and navigate application menus and modules as a user would.
- Custom UI and Forms: Simulate user interactions such as setting field values, validating fields and UI states, clicking buttons, and submitting forms.
- REST: Create and send inbound REST requests to test endpoints, including record creation, retrieval, updates, deletion, and response validations.
- Server: Execute complex server-side tests, including JavaScript unit tests using Jasmine, testing business rules, script includes, and data operations.
- Output Variables: Many test steps return output variables which can be used as inputs for subsequent steps, enabling complex, multi-step testing scenarios such as user context switching and chained record operations.
- Custom Test Steps: You can create custom test steps that run on the server, allowing input and output variable configurations to extend testing capabilities beyond built-in steps.
- Data Preservation: ATF automatically cleans up data created during tests and rolls back changes to maintain a clean testing environment.
- Test Suites: Organize tests into suites to run multiple tests sequentially or hierarchically. Suites can be scheduled to run automatically at specified times.
- Domain Separation Support: ATF supports domain separation, allowing you to manage data, processes, and administration in logical domains with controlled user access.
Practical Use and Next Steps
ServiceNow customers new to ATF should start by creating and running a basic test, such as adding a new user record, using the provided tutorial. Once comfortable with the basics, customers can explore advanced features like server-side scripting tests, custom test steps, and scheduling test suites. Leveraging ATF helps ensure consistent functionality, reduces manual testing effort, and maintains instance stability during updates and customizations.
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.