Testing is an integral part of the development cycle as it makes certain that the quality has met the desired requirements to be delivered. Automation can be achieved using a test framework, which creates and runs automatic checks to verify that our instance works as predicted even after changing. For example, after an upgrade, during any customization, the application should behave as expected.
This blog illustrates ServiceNow’s ATF and will serve as a guide to help you make knowledgeable selections regarding the same.
Introduction to Automated Test Framework
- ATF is intended for functional testing of business logics. That means your unique business processes that you manage in your ServiceNow instance.
- ServiceNow has released its Automated Test Framework (ATF) feature in Istanbul release.
- Design tests once and reuse them in different contexts and with different test data sets.
- Test both base system and custom applications.
- Reduce upgrade and development time by replacing manual testing with automated testing.
- Make the framework UI independent.
- Expect 50-70% of Tests covered.
Automated Test Framework benefits:
Listed are the benefits of ATF over other test methods
ATF Structure at a glance:
Need to assign roles to users to enable specific permissions. We can get the full list of permissions for each role in the product documentation.
Test Designer (atf_test_designer)
Web Service Test Designer (atf_ws_designer)
sn_atf.screenshots.mode should be enabledAll
Quick start tests
1. Built by the developer team and available in base system, can be leveraged by copying and customizing according to the specific need.
2. Available since Madrid release, the number of quick start tests increases subsequently with each release.
3. To see what are the quick test available for the current release, navigate to the list of available quick start tests in the product documentation.
Understanding test categories
Different types of test steps can be executed based on what to test. Below are few examples showcased with a screenshot.
1.Test steps are grouped into categories
2. When we add a test step to a new or existing test, we can filter the test step categories in the left panel to make it easier to find relevant test steps.
3. The Email category, for example includes steps for testing email functionality.
4.The service catalog category includes test steps specific to service catalog platform.
Tests may contain test steps from more than one category. For example suppose you need a test to impersonate a user, open a new form, set field values and submit form.
Recommendations for running ATF Tests
First, the client runner should be active and in the foreground for best performance
Second, Run test in only development or non-Production instances
Third, run ATF tests after making any changes to a business flow to capture regressions
Fourth, be sure to run tests before and after upgrading to capture regressions related to the upgrade.
Automated Test Framework highlights for the Tokyo release
- Leverage Parameterized Testing, Quick Start Testing, and Full Stack Testing
- Create and customize tests through OOTB templates for any ServiceNow product
- Test the UI of custom applications and portals
- Reduce risks and accelerate upgrades with instant visibility into test results
- ServiceNow offers ATF free of cost
Make a plan
- How detailed will your Tests be?
- How will your Tests be maintained?
- How will you decide what functionality to change to make a Test work?
- How will you track the features that you can’t build a Test for in ATF?
Always add the Impersonate Test Step first
- Without Impersonate, all Tests are executed as the logged in User
- You do not need to manually impersonate before running a Test
Use Record Validation after Record Update
- Record Update appears to always pass, even if the record was not updated (for example, the update was rejected by a Data Policy)
- This can lead to failures in subsequent Test Steps, and mislead you into troubleshooting the wrong Test Step
- Avoid testing data in data-driven features. Just test the functionality.
Roles to users:
Need to assign roles to users to enable specific permissions We can get the full list of permissions for each role in the product documentation.
To Sum Up
Test automation using the test automation frameworks has several benefits like faster defect analysis and minimal human intervention, while running test scripts. For businesses to acquire the optimal advantages of the automation frameworks, they must consider using a next-gen software testing service provider that has successfully built fully functional test automation frameworks with plug-and-play for continuous releases.