2
© 2021 ServiceNow , I nc. All Rights Reserved.
What best practices should I consider when creating ATF tests? (Continued)
• Keep it short – Test a discrete set of items during testing. This makes it easier to build tests and evaluate any failures. It is easy to string multiple tests
together as part of a suite and you can even use test suites hierarchically. This allows you to perform additional testing should an early step in a test fail.
• Avoid test step repetition – Don’t repeat testing for the same UI functionality in multiple tests. If other tests require similar functionality, simulate it using
server test steps rather than repeating the same UI test steps. Server test steps perform faster.
• Test the outcome – Focus on the outcome to verify rather than testing each point along the way. Keep this in mind when verifying business rules
or Flow Designer processes. When testing flows, build the conditions to trigger the flow in the test, then check the flow outcome for the expected result.
• Consider access control rule (ACL) security – When debugging unexpected test errors, a common mistake relates to security authorization. Based on the
roles of the impersonated user, a test step might fail. By default, ACL security is enforced for record inserts, updates, and deletes. Sometimes this setting
must be disabled for test steps performing actions to set up a test. Other test steps actually performing the verification might require it to be enabled.
• Validate record updates – Include a Record Validation test step after every Record Update test step to ensure the record was actually updated. A
Record Update appears to always pass even if the record was not updated for any reason, such as being rejected by a data policy. This can lead to
confusing failures in subsequent test steps. It can also mislead you in trying to troubleshoot the wrong test step.
• Test functionality instead of data – Rather than test every possible combination of a data-driven feat ure, create one or two t ests focusing on the
functionality. Then verify that the values change as intended without spending too many cycles on all the possible combinations of a vast data matrix.
• Approach conditional testing differently – When you want to perform ATF test steps based on given criteria or branch a test along different paths, create
a separate test for each condition.
What best practices should I consider when creating ATF tests? (Cont.)
Related resources
• Success Quick Answer – When and how should I use ATF?
• Product Docs – Automated Test Framework overview
• Now Community – Best practices for using ATF
• YouTube – Getting started with ATF
• Now Learning – ATF Fundamentals eLearning series
• New for developers in Paris: Overview of Automated Test Framework changes
• Customer Success Center – Upgrade quickly and maintain platform health
• YouTube – Upgrading to a new release
• YouTube – Quick start tests | Overview
• YouTube – Getting started with quick start tests